469,312 Members | 2,493 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,312 developers. It's quick & easy.

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

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.
Jul 20 '05 #1
4 8864
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
Jul 20 '05 #2
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>
<fo:table-cell/>
<fo:table-cell>

<fo:block>

<fo:table>

<!-- your table here -->

</fo:table>

</fo:block>

</fo:table-cell> <fo:table-cell/>
</fo:table-row>

</fo:table-body>

</fo:table>

HTH

AT

Jul 20 '05 #3
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

"Andrew Tyson" <asptysonATyahooD0TcomD0Tau> wrote in message
news:40**********************@news.optusnet.com.au ...
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>

<fo:table-cell/>
<fo:table-cell>

<fo:block>

<fo:table>

<!-- your table here -->

</fo:table>

</fo:block>

</fo:table-cell>

<fo:table-cell/>

</fo:table-row>

</fo:table-body>

</fo:table>

HTH

AT


Jul 20 '05 #4
On 26 Feb 2004 02:38:35 -0800, lionel <lg*******@hotmail.com> wrote:
I can't find a way to center a <fo:table> element.


If your formatter supports it, you can use:

<fo:table-and-caption text-align="center">
--
Paul.

Logic Squad -- Technical Publishing with XML -- http://logicsquad.net/
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by utterberg | last post: by
3 posts views Thread by Ali Sahin | last post: by
reply views Thread by DAnne | last post: by
reply views Thread by zamba | last post: by
2 posts views Thread by Kevin | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.