CALS table processing

TopLeaf supports a subset of the CALS table model DTD as defined at http://www.oasis-open.org/html/a502.htm.

The table and informaltable elements identify the top level container that declares the content and structure of a CALS table.

Implementation

The TopLeaf composition engine renders CALS tables incrementally — as table rows arrive — rather than waiting for all the data before beginning to render each table.

Table directionality

The directionality of a table is determined by the inherited directionality (the default is left-to-right).

Table nesting

A table cell can contain another nested table subject to the following restrictions:

  • The maximum depth of a nested table header is the data block depth less the minimum table row depth.

  • Only the outermost table header row will repeat if the table breaks across a page or column.

  • A table header declared within an <entrytbl> element will not repeat if the content of the <entrytbl> is split across a column or page boundary.

Table orientation

The orient attribute is ignored by the table processor. However, it can be used in a mapping selector to change to an appropriate layout.

Column separators

Internal table column separators are declared using the colsep attribute. This is interpreted as adding a single ruling to the right side of a table cell. If a DTD is not specified then the implied table column separator is visible. Individual mappings can control the implied table column separator by toggling the state of the Implied column separator is visible from the mapping Table tab.

Row separators

Internal table row separators are declared using the rowsep attribute. This is interpreted as adding a single ruling to the bottom edge of a table cell. If a DTD is not specified then the implied table row separator is visible. Individual mappings can control the implied table row separator by toggling the state of the Implied row separator is visible from the mapping Table tab.

Table groups

The DocBook DTD allows a table or informaltable to contain a number of graphic or mediaobject elements instead of tgroup elements.

Tables that do not declare tgroup elements are processed as non-tabular container block elements. In particular, none of the standard table styling effects (for example, the table frame style) will be applied.

Row groups

Table rows may be grouped into a table head using the thead element and one or more table body sections, each defined by a tbody. The use of a tfoot block will generate a non-fatal warning, and the block will be processed as a tbody block.

Table columns

The number of columns within a table <tgroup> is defined by the cols attribute, not by the number of <colspec/> declarations or the number of <entry> cells defined in a table row. The cols attribute must be declared as a positive integer.

Table columns widths may be specified using one or more <colspec/> declarations. If the number of table columns defined by the cols attribute exceeds the number of explicitly declared <colspec/> definitions, additional declarations equivalent to <colspec colwidth="1*" > will be inferred. The typesetting engine will generate an error if the number of <colspec/> declarations is greater than the number of columns declared in the containing <tgroup>, or when a table <entry/> or <spanspec/> range references an undefined <colspec/>.

Column widths

Column widths can be specified as either a fixed measure using one of the CALS units — pt (points), cm (centimeters), mm (millimeters), pi (picas), px (pixels) and in (inches), or a proportional measure such as “10*”.

A non-standard extension to the CALS table model recognises the following additional fixed measure units: pc (treated as a synonym for pi) and dp (decipoints).

The default fixed unit is interpreted as pt if neither a proportion or a fixed unit is specified.

Measurements in px (pixels) are converted to an absolute measure using the current device resolution. The <topleaf-properties/> directive can be used to set the device resolution.

The use of mixed mode specifications that declare a combination of proportional and fixed measures (e.g. “2*+3pt”) is not supported.

If the total requested width for all columns exceeds the available measure, TopLeaf will proportionally reduce all table widths to ensure that the table fits within the block.

Cell horizontal alignment

Explicit references to the char and charoff attributes may generate a warning when the table is rendered. A value of align="char" is interpreted as align="right"

Cell vertical alignment

A non-standard extension to the CALS table model recognises the following vertical alignment mode: step. A cell step alignment vertically aligns the first line of content in a cell with the last line of content in the previous adjacent cell. See the <cell-properties/> directive for more details.

Cross page cell vertical spanning

Cell vertical spanning is supported. The typesetting engine will generate a fatal error if a cell declares a negative vertical span. By default, a vertical span will not split across a page boundary. Use the command <table-properties split-rows="yes"/> if you want a cell vertical span to split across a page boundary.

Row splitting

CALS tables that are allowed to continue across column or page boundaries will normally break between table rows. When table row splitting is enabled, a break across a column or page boundary may also occur within a table row.

Tag processing

When CALS table processing is enabled the following elements are assumed to be components of a CALS table structure:

  • table

  • informaltable

  • thead

  • tbody

  • tfoot

  • colspec

  • spanspec

  • row

  • entry

  • entrytbl

In DTD-less mode, TopLeaf refers to an internally defined table DTD fragment that defines these tags and a set of default attribute values.

Unsupported features

The tfoot element is recognised, but does not generate a table footer block.

Limitations

See Limitations - Tables.