Latest web development tutorials

XSL-FO Formulaire

XSL-FO en utilisant <fo: table-and-caption> pour définir la forme.


Table XSL-FO (tableaux)

XSL-FO modèle de table avec HTML modèle de table ne sont pas tout à fait différente.

Il y a neuf objets XSL-FO utilisés pour créer la table:

  • fo: table-and-caption
  • fo: table
  • fo: table-caption
  • fo: table-column
  • fo: table-tête
  • fo: table-footer
  • fo: table-corps
  • fo: table-row
  • fo: table-cell

XSL-FO en utilisant<fo: table-and-caption > élément pour définir la forme.Il contient un<fo: table> et une <fo: caption>option élément.

<Fo: table> élément contient une option<fo: table-column>, une option <fo: table-header>élément, un<fo: table-body>,une option<fo: table -footer>élément. Chacun de ces éléments peut avoir un ou plusieurs<fo: table-row> éléments, <fo: table-row>aura également un ou plusieurs<fo: table-cell>élément:

<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>

La sortie du code ci-dessus est la suivante:

voiture prix
Volvo 50000 $
SAAB 48,000 $