Search code examples
xsltxslt-1.0xslt-2.0xsl-fo

Is there any way to make full page table?


I want to make this table a 100% height too.

The table as it appears at the moment

XSLT fragment:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

  <!-- defines the layout master -->
      <fo:layout-master-set>
        <fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>

  <!-- starts actual layout -->
  <fo:page-sequence master-reference="simpleA4">

    <fo:flow flow-name="xsl-region-body">
 
      <fo:table width="110mm" border-style="outset" border-width="1pt">
        <fo:table-column column-number="1" column-width="80%" border-style="solid" border-width="1pt"/>
        <fo:table-column column-number="2" column-width="80%" border-style="solid" border-width="1pt"/>
        <fo:table-body>
            <xsl:apply-templates select="etiqueta"/>
        </fo:table-body>
      </fo:table>

    </fo:flow>
  </fo:page-sequence>
</fo:root>

Solution

  • You practically answered it for yourself. Use:

    <fo:table height="100%">
    

    To make the last row expand to fill the height to make the table fill the page, you may need this on an fo:table-cell in the last row:

    <fo:table-cell block-progression-dimension.optimum="100%">
    

    You don't say which formatter you are using, so this might or might not work for you.