Creating Tables

Some of the most useful constructs you can format with XSL-FO are tables. A table in XSL-FO is much like one in HTML: a rectangular grid of rows and columns of cells. You can use nine formatting elements to create tables:

  • <fo:table-and-caption>

  • <fo:table>

  • <fo:table-column>

  • <fo:table-caption>

  • <fo:table-header>

  • <fo:table-footer>

  • <fo:table-body>

  • <fo:table-row>

  • <fo:table-cell>

Creating tables in XSL-FO is similar to creating tables in HTML. You create an <fo:table> element to enclose the entire table, then format each column with an <fo:table-column> element. Next, create an <fo:table-body> element to specify the table’s body. The <fo:table-body> element encloses all the <fo:table-row> elements, each of which creates a row in the table. ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.