XSL FO – How To Center A Table Horizontally

<?xml version=”1.0″?>

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

<fo:layout-master-set>

<fo:simple-page-master master-name=”content” page-width=”210mm” page-height=”297mm”>

<fo:region-body/>

</fo:simple-page-master>

</fo:layout-master-set>

<fo:page-sequence master-reference=”content”>

<fo:flow flow-name=”xsl-region-body”>

<fo:table table-layout=”fixed” width=”100%”>

<fo:table-column column-width=”proportional-column-width(1)”/>

<fo:table-column column-width=”100mm”/>

<fo:table-column column-width=”proportional-column-width(1)”/>

<fo:table-body>

<fo:table-row>

<fo:table-cell column-number=”2″>

<fo:block>foo</fo:block>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

</fo:table>

</fo:flow>

</fo:page-sequence>

</fo:root>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.