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

To modify 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, expand Formatting > specific.
  3. Click cell width and then the ellipsis button in the Value column. Enter a value and click OK.
To modify column alignment for a cell
  1. Select a Cell to modify.
  2. In the Properties view, expand Formatting > specific.
  3. Click cell alignment and then the ellipsis button in the Value column. Select an alignment option and click OK.
To modify column size for a table
  1. Select the Table.
  2. In the Properties view, expand Formatting > specific.
  3. Click table auto fit and then enter a numeric value or click the ellipsis button in the Value column. Select an option and click OK.

In Rational Publishing Engine 1.1.2 and earlier, when you customize the details for a table and enter autofit to window as the table auto fit value, the column sizes are dependent on the values entered for each cell width. If a cell width is not specified, that cell is allotted the most space. The content contained within the cell is not taken into account for the column width.

In Rational Publishing Engine 1.1.2.1 and later, 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, expand Formatting > specific.
  3. Click resize to fit contents and the ellipsis button in the Value column. Select an option and click OK.

In Rational Publishing Engine version 1.1.2.1 and later, 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, expand Formatting > specific.
  3. Click row repeat at page beginning and then the ellipsis button in the Value column. Select True and click OK.
    Note: You can also manually enter the value as True in the Value column.
To avoid splitting data rows when a table beyond a page boundary
  1. Select the Row to modify.
  2. In the Properties pane, expand Formatting > specific.
  3. Click row break across pages and then the ellipsis button in the Value column. Select False and click OK.
    Note: You can also manually enter the value as False in the Value column.

If you do not want any row to be split between pages, you need to set this 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, expand Formatting > specific.
  3. Click once per table and then the ellipsis button in the Value column. Select True and click OK.
    Note: You can also manually enter the value as True in the Value column. This property is applied to the entire row of the table and not to individual cells.
To add text in a cell

All of the cells (columns) in the table will have a common selection for styles, font properties, character properties, effects, line, border and color.

The Text item is selected and the Formatting > font set of properties is expanded in the Properties view. Within that set, the font family property is set to Arial and the bold property is changed from its default value of false to true. Note: The font size is left blank which will cause a default size to be applied in the output document.
  1. Click Select from the Palette and click a specific cell. The cell is highlighted with a border.
  2. Click Text from the Palette.
  3. Point the cursor in a cell and click or in the Outline view, expand Table and click the Cell in which you want to add text.
  4. In the Properties view, expand Formatting and apply the required options.

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. Click Select from the Palette and click a specific cell. The cell is highlighted with a border.
  2. In the Properties view, expand Formatting > specific.
  3. Click row span and 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. Click Select from the Palette and click a specific cell. The cell is highlighted with a border.
  2. In the Properties view, expand Formatting > specific.
  3. Click column span and 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, expand Formatting > border > border style.
  3. For the top border style property, click the ellipsis.
  4. Select the script expression tab and enter the following script:
    if(TableTopBorder == "TableBorderFull")
    {
    "single"
    }
    else if(TableTopBorder == "TableBorderDotted")
    {
    "dotted"
    }
    else if(TableTopBorder == "TableBorderNone")
    {
    "none"
    }
  5. Repeat for the right border style, bottom border style, and left border style properties.
  6. Save the changes.

Feedback