472,129 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,129 software developers and data experts.

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 9106
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.