XSL-FO Table
XSL-FO uses the <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 used to create a table:
- 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 the <fo:table-and-caption> element to define a table. It contains a <fo:table> and an optional <fo:caption> element.
The <fo:table>
element contains optional <fo:table-column> elements, an optional <fo:table-header> element, a <fo:table-body> element, and an optional <fo:table-footer> element. Each of these elements may have one or more <fo:table-row> elements, and the <fo:table-row> contains one or more <fo:table-cell> elements:
The output of the above code is as follows:
Car | Price |
---|---|
Volvo | $50000 |
SAAB | $48000 |