How to center a <fo:table> element ? (XSLFO)

Discussion in 'XML' started by lionel, Feb 26, 2004.

  1. lionel

    lionel Guest

    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.
     
    lionel, Feb 26, 2004
    #1
    1. Advertising

  2. lionel

    Andrew Tyson Guest


    > 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
     
    Andrew Tyson, Feb 26, 2004
    #2
    1. Advertising

  3. lionel

    Andrew Tyson Guest

    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
    >
    >
     
    Andrew Tyson, Feb 26, 2004
    #3
  4. lionel

    john farrow Guest

    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:403dddec$0$5871$...
    > 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
    > >
    > >

    >
    >
     
    john farrow, Feb 26, 2004
    #4
  5. On 26 Feb 2004 02:38:35 -0800, lionel <> 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/
     
    Paul A. Hoadley, Feb 27, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabriel

    XSLFO Ref guide

    Gabriel, Mar 18, 2005, in forum: XML
    Replies:
    0
    Views:
    428
    Gabriel
    Mar 18, 2005
  2. Replies:
    0
    Views:
    477
  3. RickH

    Freeware xml/xslfo to pdf

    RickH, Jul 25, 2006, in forum: XML
    Replies:
    3
    Views:
    3,446
    jon001
    Oct 30, 2011
  4. TS
    Replies:
    5
    Views:
    3,691
    Steven Cheng[MSFT]
    Aug 16, 2007
  5. HANM
    Replies:
    2
    Views:
    723
    Joseph Kesselman
    Jan 29, 2008
Loading...

Share This Page