Fixed Width Tables

The first type of table is a fixed width table, a table that does not dynamically resize based on its contents. In a fixed width table, the table information is used in the following manner:

  • The table grid is used to create the set of shared columns in the table and their initial widths as defined in the <tblGrid> element

  • The table’s total width is defined based on the <tblW> property – if it is set to auto or nil, then the width is not yet determined and will be specified using the row and cell information.

  • The first table row is read and the initial number of grid units before the row starts is skipped. The width of the skipped grid columns is set using the <wBefore >property.

  • The first cell is placed on the grid, and the width of the specified grid column span set by <gridSpan> is set based on the <tcW> property.

  • Each additional cell is placed on the grid.

  • If at any stage, the preferred width requested for the cells exceeds the preferred width of the table, then each grid column is proportionally reduced in size to fit the table width.

  • If the grid is exceeded (e.g., <tblGrid> specifies three grid columns, but the second cell has a <gridSpan> of three), the grid is dynamically increased with a default width for the new grid column.

  • For each subsequent row, cells are placed on the grid, and each grid column is adjusted to be the maximum value of the requested widths (if the widths do not agree) by adding width to the last cell that ends with that grid column. Again, if at any point, the space requested for the cells exceeds the width of the table, then each grid column is proportionally reduced in size to fit the table width.