O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Tables

Some of the most useful constructs that you can format with XSL are tables. A table in XSL is much like one in HTML—a rectangular grid of rows and columns of cells. You can use nine formatting objects 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 is a little involved in XSL. You create a fo:table object and then format each column with a fo:table-column object. Then you create a table-body object, as well as table-row objects for each row and table-cell objects for each cell in each row. Here's an example creating a 3×3 table with the words Tic, Tac, and Toe repeated on each line:

Listing . ch14_08.fo
 <?xml version="1.0" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required