XSL-FO Tablo

XSL-FO, tabloyu tanımlamak için <fo:table-and-caption> elementini kullanır.

XSL-FO Tablo

XSL-FO tablo modeli, HTML tablo modelinden çok farklıdır.

XSL-FO, tablo oluşturmak için dokuz tür nesne kullanabilir:

  • 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 <fo:table-and-caption> bir tablo tanımlamak için kullanılır. Bu, bir <fo:table> ve bir seçmeli <fo:caption> Element.

<fo:table> elementi içerir:

  • Opsiyonel <fo:table-column> elemente sahip olabilir
  • Opsiyonel <fo:table-header> elemente sahip olabilir
  • <fo:table-body> elemente sahip olabilir
  • Opsiyonel <fo:table-footer> elemente sahip olabilir

bu elementlerin her biri bir veya daha fazla <fo:table-row> elementi de içerebilir <fo:table-row> Aynı zamanda bir veya daha fazla <fo:table-cell> Elementler:

<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">Araba</fo:block>
    </fo:table-cell>
    <fo:table-cell>
      <fo:block font-weight="bold">Fiyat</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>

Bu kodun çıktısı: