Formatting a table

You can modify the column specification and the behavior of rows in a table.

About this task

This topic contains information about:

When choosing an element to edit, you can select one from the editor or select one from the Outline view. To display the Outline view in the Rational® Publishing Engine Document Studio, click Window > Show View > Outline.

After selecting an element, you can modify its properties in the Properties view. To display the Properties view, click Window > Show View > Properties.

Note: Modifying the column width and alignment as described in this topic is different from creating an irregularly shaped table. Irregularly shaped table have a different number of cells per row and, in most common scenarios, come from the data as rich text.

Formatting columns

You can adjust the column width and content alignment for individual cells in a table. The table properties work together with the properties for a cell to produce the column width for a cell.

Procedure


Table 1. Modifying column widths and alignment
Task How to
To modify column width for a cell
  1. Select a Cell to modify.
  2. In the Properties view, select the Specific tab.
  3. For Cell width enter a value.
To modify column alignment for a cell
  1. Select a Cell to modify.
  2. In the Properties view, select the Specific tab.
  3. Select an option for the Cell alignment field.
To modify column size for a table
  1. Select the Table.
  2. In the Properties view, select the Specific tab.
  3. For the Table auto fit property, select an option.

When you customize the details for a table and enter autofit to window as the Table auto fit value, columns increase and decrease in size depending on the amount of content contained within the cell. If a cell does not contain any content, but has a cell width value entered, the cell width value might be adjusted to allot for more or less space based on the content in the other columns. To override this behavior and create a column wider than the content it contains, clear the autofit to window value and enter a numeric value for the column. Example: 500

To modify word wrapping in a table
  1. Select the Table.
  2. In the Properties view, select the Specific tab.
  3. For the Resize to fit contents select an option and click OK.

You can also modify the Resize to fit contents table property by selecting or clearing the check box. When the check box is selected and Resize to fit contents is true, long text that does not contain any spaces is broken and wrapped within the cell. When the check box is cleared and Resize to fit contents is false, long text that does not contain any spaces is not broken and extends to the edge of the page.

Formatting rows

Procedure

To modify rows:
Task How to
To repeat heading rows when a table extends beyond a page boundary
  1. Select the first Row to modify as the header.
  2. In the Properties view, select the Specific tab.
  3. For Row repeat at page beginning, select true.
    Note: You can also manually enter the value as true.
To avoid splitting data rows when a table beyond a page boundary
  1. Select the Row to modify.
  2. In the Properties view, select the Specific tab.
  3. Click Row break across pages and select false.
    Note: You can also manually enter the value as false.

If you do not want any row to be split between pages, you must set this property for every row in the table as it is a row property.

To have a row appear only once in a table
  1. Select the Row to modify.
  2. In the Properties view, select the Specific tab.
  3. For the Once per table field, select true.
    Note: You can also manually enter the value as true. This property is applied to the entire row of the table and not to individual cells.

Formatting cells

You can set the properties for a cell to span multiple rows or columns within a table. Setting row and column spans is a method for adjusting the height or width of a cell in a regularly shaped table.

Before you begin

  1. All rows or columns must contain the same number of cells.
  2. Remove properties set for the individual cells contained in the span.
  3. Avoid overlapping a span with another span.
  4. Generate the output in multiple formats to test the display of the table.

Procedure

To modify cell structures:
Task How to
To adjust the height a cell by spanning multiple rows
  1. Select a Cell. The cell is highlighted with a border.
  2. In the Properties view, select the Specific tab.
  3. For the Row span property, enter the number of rows for the cell to span. For example, to double the height of the cell, enter 2. The cell is the height of two rows.
To adjust the width a cell by spanning multiple columns
  1. Select a Cell. The cell is highlighted with a border.
  2. In the Properties view, select the Specific tab.
  3. For the Col span property, enter the number of columns for the cell to span. For example, to double the width of the cell, enter 2. The cell is the width of two columns.

Formatting cells with scripts

Procedure

To apply a border style script:

  1. Select a cell element.
  2. In the Properties view, select the Border tab.
  3. If it is not already selected, select the All border icon All border icon. This option is selected by default.
  4. For the Style property, click the ellipsis.
  5. Select the script expression tab and enter the following script:
    if(TableTopBorder == "TableBorderFull")
    {
    "single"
    }
    else if(TableTopBorder == "TableBorderDotted")
    {
    "dotted"
    }
    else if(TableTopBorder == "TableBorderNone")
    {
    "none"
    }
  6. Save the changes.

Feedback