OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Centering a table on a page with FO


As you discovered, this is much harder than it should be.  Yes, in XSL-FO
1.0, centering a table requires you to put the table in another layout
table that centers it.  However, you don't have to do this in your XML
files.  Rather, the stylesheet could respond to the align attribute and
place the table in another fo:table to center it.

I started to add that at one point, but found that the different FO
processors behaved differently, and didn't get around to sorting out the
conditional code required to make it work reliably.  If you are using
Antenna House or XEP, I believe each of their FAQs has an entry on how to
center a table.

Oddly enough, the original Cals table spec did not include an align
attribute on the table element, so the stylesheets didn't support it.  It
was introduced into DocBook 4.3 when the HTML table model was added to the
DTD.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Mike Broschinsky" <mbroschi@utah.gov>
To: <docbook-apps@lists.oasis-open.org>
Sent: Thursday, February 16, 2006 12:18 PM
Subject: [docbook-apps] Centering a table on a page with FO


I have a number of tables in a manual that our office produces. You can see
the HTML output from the DocBook source at:

http://www.rules.utah.gov/manual-rw/index.html

(I'm actually quite proud of this, having talked my boss into letting me
use DocBook, and yet having few XML/XSLT/HTML/CSS skills.)

You can see that the tables on the various HTML pages are horizontally
centered in the viewport. See, for example:

http://www.rules.utah.gov/manual-rw/ch01s01.html

I want to be able to do the same for the print output, i.e. center a table
horizontally on the page, if possible.

So, I'm pretty sure this question has been asked before, but because I am
new to DocBook and XSLT, the answers that I found subsequent to a Google
search seemed pretty complicated and involved using another table as a
wrapper around the table I want to center.

Extraneous elements bother me more than a table aligned on the left margin.
Is there a way to center a table on a page using the stock DocBook
stylesheets and a customization layer, but not adding extra columns to a
table or wrapping the table in another table? If not, I'm happy to live
with the left-aligned table until the happy day when I *can* center it.

Thanks!

Mike


----------------------------

Mike Broschinsky
Administrative Code Editor
Utah State Division of Administrative Rules
801-538-3003
mbroschi@utah.gov


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org






[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]