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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lionel

    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.
  • Andrew Tyson

    #2
    Re: How to center a &lt;fo:table&gt ; element ? (XSLFO)

    [color=blue]
    > I can't find a way to center a <fo:table> element.[/color]

    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


    Comment

    • Andrew Tyson

      #3
      Re: How to center a &lt;fo:table&gt ; element ? (XSLFO)

      whoops - looks like I missed out some cells
      [color=blue]
      > <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>
      >[/color]
      <fo:table-cell/>
      [color=blue]
      > <fo:table-cell>
      >
      > <fo:block>
      >
      > <fo:table>
      >
      > <!-- your table here -->
      >
      > </fo:table>
      >
      > </fo:block>
      >
      > </fo:table-cell>[/color]
      <fo:table-cell/>[color=blue]
      >
      > </fo:table-row>
      >
      > </fo:table-body>
      >
      > </fo:table>
      >
      >
      >
      > HTH
      >
      > AT
      >
      >[/color]


      Comment

      • john farrow

        #4
        Re: How to center a &lt;fo:table&gt ; element ? (XSLFO)

        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:403dddec$0 $5871$afc38c87@ news.optusnet.c om.au...[color=blue]
        > whoops - looks like I missed out some cells
        >[color=green]
        > > <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>
        > >[/color]
        > <fo:table-cell/>
        >[color=green]
        > > <fo:table-cell>
        > >
        > > <fo:block>
        > >
        > > <fo:table>
        > >
        > > <!-- your table here -->
        > >
        > > </fo:table>
        > >
        > > </fo:block>
        > >
        > > </fo:table-cell>[/color]
        > <fo:table-cell/>[color=green]
        > >
        > > </fo:table-row>
        > >
        > > </fo:table-body>
        > >
        > > </fo:table>
        > >
        > >
        > >
        > > HTH
        > >
        > > AT
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Paul A. Hoadley

          #5
          Re: How to center a &lt;fo:table&gt ; element ? (XSLFO)

          On 26 Feb 2004 02:38:35 -0800, lionel <lgoutagny@hotm ail.com> wrote:
          [color=blue]
          > I can't find a way to center a <fo:table> element.[/color]

          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/

          Comment

          Working...