How to center a <fo:table> element ? (XSLFO)

L

lionel

Hello yall,

I can't find a way to center a <fo:table> element.

I have tried many attributes
(display-align,start-indent,padding-start,...).

I have tried to encapslulate it in a <fo:block> element and even in a
<fo:block-container> but whatever I whrite, it still appear on the
left side of my PDF document when I'm using nFOP to generate my PDF
from my FO document.

I just don't know what to do, please help.

Thanks.
 
A

Andrew Tyson

I can't find a way to center a <fo:table> element.

How about creating a table element the width of the page, with a single row,
containing
a three cells, where the block body contains your table, and is encapsulated
within the middle cell;

<fo:table width="100%">

<fo:table-column column-width="33%"/>

<fo:table-column column-width="33%"/>

<fo:table-column column-width="33%"/>

<fo:table-body>

<fo:table-row>

<fo:table-cell>

<fo:block>

<fo:table>

<!-- your table here -->

</fo:table>

</fo:block>

</fo:table-cell>

</fo:table-row>

</fo:table-body>

</fo:table>



HTH

AT
 
A

Andrew Tyson

whoops - looks like I missed out some cells
<fo:table width="100%">

<fo:table-column column-width="33%"/>

<fo:table-column column-width="33%"/>

<fo:table-column column-width="33%"/>

<fo:table-body>

<fo:table-row>
 
J

john farrow

You can just set the start and end indent values to the same, like this:

<fo:table start-indent="4cm" end-indent="4cm">

that should do it.

Regards

John

Visual Programming Ltd mail PO Box 22-222, Khandallah, Wellington, New
Zealand site Level 2, 2 Ganges Road, Khandallah, Wellington, New Zealand
phone +64 4 479 1738 fax +64 4 479 1294 web http://www.xmlpdf.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top