473,597 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9217
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" <asptysonATyaho oD0TcomD0Tau> wrote in message
news:40******** **************@ news.optusnet.c om.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*******@hotm ail.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
3152
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 with name categ2 and categ6 ) and format table in same manner.... I have add a variable named numrows, for dynamic display rows, is possible?
3
4037
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
1948
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> subsitutes the position of the node correctly as I expected. This is fine with MSXML 3.0 & MSXML 4.0 plus the XmlSpy internal engine. I have been able to reproduce using a simpler Xml and Xsl to demonstrate; XML
3
2389
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" href="D:\app\jboss-3.2.5\server\default\deploy\xifs.war\WEB-INF\classes\de\xifs\resource\xml\de\xifs\resource\xml\dunningaccountreport_de.xsl"?> <!DOCTYPE entities >
0
3289
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. Each section has a list of questions. Each question has responses. I need to display a list of responses to the questions (i.e. set:distinct), once and only once, each section. My second problem is that these questions can also have corrective...
2
2511
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
28096
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 views along with 2 other tables and I would like put a condition at the...something like AND Table1 IS NOTEMPTY Is there a way to do this in MS SQL?
0
1471
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 me i will appreciatte : <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
2
3006
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 elements (children of log) in my XML source have a time-stamp attribute, so I want to use the time-stamp from the page for the page-time-stamp value. I use an xsl:choose/xsl:when/xsl:otherwise combination to setup an if/else statement to select the...
0
7971
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7893
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8276
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8381
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3889
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2408
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1495
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.