Latest web development tutorials

XSL-FO Form

XSL-FO menggunakan <fo: table-dan-caption> elemen untuk menentukan bentuk.


meja XSL-FO (Tabel)

Model meja XSL-FO dengan Model meja HTML tidak benar-benar berbeda.

Ada sembilan objek XSL-FO yang digunakan untuk membuat tabel:

  • fo: table-dan-caption
  • fo: table
  • fo: table-caption
  • fo: table-kolom
  • fo: table-header
  • fo: table-footer
  • fo: table-tubuh
  • fo: table-baris
  • fo:-sel tabel

XSL-FO menggunakan<fo: table-dan-caption > elemen untuk menentukan bentuk.Ini berisi<fo: table> dan opsional <fo: caption>elemen.

<Fo: table> elemen berisi opsional<fo: table-kolom> elemen, opsional <fo: table-header>elemen, sebuah<fo: table-body>elemen, opsional<fo: table -footer>elemen. Masing-masing elemen dapat memiliki satu atau lebih<fo: table-baris> elemen, <fo: table-baris>akan juga memiliki satu atau lebih<fo:-sel tabel>elemen:

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

Output dari kode di atas adalah sebagai berikut:

mobil harga
volvo $ 50.000
SAAB $ 48.000