XSL-FO-Formular
XSL-FO mit <fo: table-and-caption> Elementform zu definieren.
XSL-FO Tabelle (Tabellen)
XSL-FO-Tabellenmodell mit Modell HTML-Tabelle ist nicht völlig anders.
Es gibt neun XSL-FO-Objekte verwendet, um die Tabelle zu erstellen:
- fo: table-and-caption
- fo: table
- fo: table-caption
- fo: table-column
- fo: table-header
- fo: table-footer
- fo: table-Körper
- fo: table-row
- fo: table-cell
XSL-FO mit<fo: table-and-caption > Elementform zu definieren.Es enthält eine<fo: table> und eine optionale <fo: caption>Element.
<Fo: table> Element enthält eine optionale<fo: table-column> -Element, ein optionales <fo: table-header>Element, ein<fo: table-body>-Element, ein optionales<fo: table -footer>-Element. Jedes dieser Elemente kann ein oder mehrere<fo: table-row> -Elemente, <fo: table-row>wird auch eine oder mehrere<fo: table-cell>Element:
<fo:table-and-caption>
<fo:table>
<fo:table-column column-width="25mm"/>
<fo:table-column column-width="25mm"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block font-weight="bold">Car</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold">Price</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>Volvo</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>$50000</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>SAAB</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>$48000</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-and-caption>
<fo:table>
<fo:table-column column-width="25mm"/>
<fo:table-column column-width="25mm"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block font-weight="bold">Car</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold">Price</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>Volvo</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>$50000</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>SAAB</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>$48000</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-and-caption>
Die Ausgabe des Codes ist oben, wie folgt:
Auto | Preis |
---|---|
Volvo | $ 50.000 |
SAAB | $ 48.000 |