Re: [xsl] FO: center a table

Subject: Re: [xsl] FO: center a table
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Dec 2005 10:31:15 -0500
Sorry, I responded to the response but not the original post, so I didn't see that the original poster already had a test example.

At 2005-12-27 11:21 +0100, Florent Georges wrote:
  I can't figure out how to make this simple task: I have a fo:table in
a fo:flow, and I have to center the table horizontally in the flow.
Something like the following, but with centering the table:

The following change to your example works just fine. I added a table-and-caption to centre the table, then I added a text-align="start" to start-align the table contents, and I turned on the border to see that it was, indeed, in the centre of the line.

I hope this helps.

. . . . . . . . . . Ken

<?xml version="1.0"?>
<fo:root xmlns:fo="";>
    <fo:simple-page-master master-name="master"
      <fo:region-body margin-left="50pt"
  <fo:page-sequence master-reference="master">
    <fo:flow flow-name="xsl-region-body">
      <fo:table-and-caption text-align="center">
        <fo:table width="100pt" table-layout="fixed" text-align="start"
                  border="solid 1pt">
          <fo:table-column column-width="100pt"/>

-- Upcoming XSLT/XSL-FO hands-on courses: Denver,CO March 13-17,2006 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 Legal business disclaimers:

Current Thread