W3C home > Mailing lists > Public > www-xsl-fo@w3.org > July 2002

AW: center table horizontally (space-start)

From: Schäffler, Markus SFR <Schaeffler@boehme-weihs.de>
Date: Wed, 17 Jul 2002 17:08:31 +0200
Message-ID: <B1521BAD368DD411ABB40050DA5EF304E16720@ntmail.en.boehme-weihs.de>
To: "Mailing List XSL-FO (E-Mail)" <www-xsl-fo@w3.org>

Thanks for the help so far.
The start-indent attribute works for a table without a border fine, but when
you use it for a table with a border only the content is indented and the
border is still at the same place. Does anybody know how to indent both?

Best Regards
Markus Schäffler

-----Ursprüngliche Nachricht-----
Von: G. Ken Holman [mailto:gkholman@cranesoftwrights.com]
Gesendet: Dienstag, 16. Juli 2002 19:00
An: Mailing List XSL-FO (E-Mail)
Betreff: Re: center table horizontally (space-start)

At 2002-07-16 17:14 +0200, Harm Kok wrote:
>Table-and-caption does not work in fop (not supported).

Sorry ... I don't use FOP so I was unaware of the restriction.  I've tested 
and used this approach successfully on Antenna House.

>I also have encountered the same problems in FOP and did not find the 
>right solution yet.

My response was, I believe, the only elegant solution ... see the last 
paragraph of 7.15.10.

If you are dealing with a fixed width table, then there is another approach 
you could follow that is a bit cumbersome:

   <table border="solid" border-collapse="collapse" table-layout="fixed"
          start-indent="( 100% - 4cm ) div 2">
     <table-column column-width="2cm"/>
     <table-column column-width="2cm"/>
     <table-body start-indent="0pt">

... but you need to know the size of the table before-hand.  See how I take 
the difference between the entire width (100%) and the table width (4cm) 
and divide that difference by 2 to get how much belongs on the left.  The 
end-indent isn't needed because of the fixed table width.

Note that I had to "undo" the start-indent= at the table-body, otherwise 
inheritance would have applied that indent to every cell's content.

I hope this helps.

............... Ken

Upcoming: 3-days XSLT/XPath and/or 2-days XSL-FO:Sep 30-Oct 4,2002

G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0  +1(613)489-0999 (Fax:-0995)
ISBN 0-13-065196-6                       Definitive XSLT and XPath
ISBN 1-894049-08-X   Practical Transformation Using XSLT and XPath
ISBN 1-894049-07-1                Practical Formatting Using XSLFO
XSL/XML/DSSSL/SGML/OmniMark services, books (electronic, printed),
articles, training (instructor-live,Internet-live,web/CD,licensed)
Next public training:                 2002-08-05,26,27,09-30,10-03
Received on Wednesday, 17 July 2002 11:08:38 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:26 UTC