473,395 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 9193
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Luca | last post by:
Hi, have a problem with xslt posted below, this stylesheet format a table like Yahoo directory, but I need exclude (from xslt) all categ element without sublink element (in this case category...
3
by: utterberg | last post by:
If I have an xml that looks something like this: <section> <item> <label>label one</label> <data>123</label> </item> <item> <label>label two</label> <data>456</label>
3
by: b0yce | last post by:
Hi Group, I think I have found a problem with the <xsl:element> when being transformed by the .NET xmlTransform class. When using XmlSpy for development and debugging, the <xsl:number>...
3
by: Ali Sahin | last post by:
Hi there, I'd like to transform a XML-File to PDF. The XML-File ist build like followed: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml-stylesheet type="text/xsl"...
0
by: DAnne | last post by:
Hi, I'm very new to xslt and this is my first time posting to a Forum so please forgive me if I transgress any protocols. I have to do a tally report. This report is divided up into sections....
2
by: morrell | last post by:
I have a request to find out is there an easy way to solve this little poblem. ___________________ | Block 1 | | | | | | |...
7
by: Yas | last post by:
Hi, is there a way I can check if a table is empty and contains no rows? I have a Table1 which being dynamic can sometimes end up with now columns what so ever. I'm using Table1 in one of my...
0
by: zamba | last post by:
hi im new with xsl and i have to process a xsl with a lot of xml (about 50.000) the transform is slow ..and i want to optimize my xsl . here is the example so if anybody could give some advices to...
2
by: Kevin | last post by:
I am having difficulty updating a variable page-time-stamp in the following snippit. The variable time-stamp is initialized from the attribute time-stamp from the log element. Some of the page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.