XSL-FO Tables
XSL-FO uses fo:table-and-caption element to define a table.
XSL-FO Tables
The XSL-FO table model is not entirely different from the HTML table model.
There are nine XSL-FO objects that can be used to create tables:
- fo:table-and-caption
- fo:table
- fo:table-caption
- fo:table-column
- fo:table-header
- fo:table-footer
- fo:table-body
- fo:table-row
- fo:table-cell
XSL-FO uses fo:table-and-caption element to define a table. It contains a <fo:table> and an optional fo:caption .
fo:table element contains an optional fo:table-column element, an optional fo:table-header element, a fo:table-body element, an optional fo:table-footer element. Each of these elements may have one or more fo:table-row elements, and fo:table-row also carries one or more fo:table-cell element:
fo:blockVolvo
fo:block$50000
fo:blockSAAB
fo:block$48000
The output of the above code is as follows:
| Car | Price |
|---|---|
| Volvo | $50000 |
| SAAB | $48000 |