Table of Contents

Article

How to adjust layout cell width in auto-generated 4.2 section rules

Summary

A developer asks: In V4.1, when I save a section rules with two columns of data, the width property of each cell is automatically set to 25% (one-fourth of the available width for each label, and one-fourth for each value).

In Version 4.2 , when I create a section rule with the same two-column layout, the cells created have no width attribute. This means that at runtime, the sections look misaligned.

  • Is this change in behavior intended?
  • Is there any way to automatically defining the widths of each cell in V4.2, such as by using CSS styles?
  • Will future changes to the harness section rules resolve this issue?



 

Suggested Approach

Update: In V4.2SP4 and later, new options on the Section form provide you with greater control over column widths.

In V4.1, when you save a Harness form, HTML code generation assigns a fixed width to each column.  This approach has a serious shortcoming: When a section has several columns of varying widths, space is wasted. Columns with narrow data content can consume a lot of real estate.

In V4.2, each column takes as much width as it needs at runtime. For example, if data in the column is only two characters wide, your column is narrow.  If data and fields in the column include a value that is 60 characters wide, the column adjusts to accommodate it.

If desired, you can revise this default behavior by padding the columns to be certain width.  You can control the width of the column by controlling the HTML Property rule that applies to the property in the column. .

As an example, consider the case of a simple text value.  If the associated HTML Property rule simply includes the following code:

{$this-value}

then the cell appears at runtime only as wide as the data requires.

However if you associate the property with an HTML Property rule that contains:

<span style="width:300px">
      {$this-value}
</span>

then the cell and the entire column containing the cell appears 300 pixels wide.

Similarly, you can use a text box to resize the column, by requiring a higher number of characters. The easiest way to do that is to set the Expected Size field on the Property form itself, rather than through HTML Property rules.

Tags:

Published March 14, 2005 — Updated November 15, 2015

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.