Tables

Implementation

TopLeaf applies an internal preprocessor that transforms the structure of each CALS or HTML table row prior to rendering the table row. It is not possible to reconstruct a table after this transformation has been applied. If you need to re-use tabular material you should do this by pre-processing your XML source prior to typesetting.

Table model

TopLeaf does not support the use of CALS and HTML tables from within the same document or mappings to both CALS and HTML table tags from within the same style sheet.

Table elements

The processing of all recognised CALS or HTML table element names is case insensitive. For example, when processing CALS table elements, TopLeaf regards the tags <entry> and <Entry> as identical.

The processing of all recognised table attribute names is case insensitive. For example, when processing the CALS table row tag, the attributes rowsep="1" and Rowsep="1" identify the same attribute.

These restrictions may have implications when mapping CALS or mapping HTML table elements.

Table spacing

If a table is positioned immediately within a box, then the vertical space above the table is determined by the sum of the box style top text indent and the above space declared by the current table style. Otherwise, the vertical space above the table is the larger of the above space declared by the current table style and any pending inter-paragraph space.

Table headers

The outermost table header is an implicitly bound structure that is automatically repeated at the top of each column or page boundary that occurs within the scope of a table.

Table rows

When rendering a multi-row table header, or within rows containing table cells that span more than one row, TopLeaf applies a built-in transform to the table header or spanned content before processing the rows as a single unit. Only the first row in this unit is used for styling purposes — mappings for the other rows are ignored. It is not possible to map or test the occurrence of a table row in a multi-row table header or a table row containing a cell that spans more than one row.

For example, the following CALS table declares a vertical span:

<table><tgroup cols="2"><tbody>
<row outputclass="red"><entry>A</entry><entry morerows="1">B</entry></row>
<row outputclass="blue"><entry>C</entry></row>
</tbody></tgroup></table>

The row mapping sets the background color using the outputclass attribute. In this case the entire table will have a red background color, because the mapping for the second row element is ignored.

Table cells

It is not possible to map or test the occurrence of a table cell in a multi-row table header or a table row containing a cell that spans more than one row.

Scanned content

The following restrictions apply when scanning content the content of and within a table:

  • If a mapping for a CALS or HTML top level table element (for example, a <table> tag mapping) scans its content, then the entire table is automatically suppressed.

  • The scanned <content/> for a top level table tag mapping may only be processed by passing that content to a Perl extension or by assigning it to an XML fragment for use with the <xmlproc/> command.

  • The content of a table cell may be scanned, suppressed, or reused (for example, by assigning it to a running head or footnote).

  • The content within any other CALS or HTML table element can not be scanned, suppressed, or reused.

An attempt to override these constraints will cause the typesetting engine to generate a non-fatal warning.

Row separators

A row separator may be incorrectly displayed at the end of a table.