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

Lionel

Usenet Archive
Joined
Jun 22, 2000
Messages
141
Reaction score
0
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.
 

Andrew Tyson

Usenet Archive
Joined
Oct 18, 2002
Messages
24
Reaction score
0
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
 

Andrew Tyson

Usenet Archive
Joined
Oct 18, 2002
Messages
24
Reaction score
0
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>
 

john farrow

Usenet Archive
Joined
Aug 19, 2001
Messages
23
Reaction score
0
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

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top