Loading ...
Sorry, an error occurred while loading the content.

Re: [XSL-FO] table align center

Expand Messages
  • Chris Bowditch
    ... To horizontally centre a table, place it inside an outer table like this:
    Message 1 of 5 , Sep 2, 2004
    • 0 Attachment
      carlos müller wrote:

      > How Can I align a table at center horizontally? I don´t know the size of
      > her
      > in design time.

      To horizontally centre a table, place it inside an outer table like this:

      <fo:table table-layout="fixed">
      <fo:table-column width="proportional-column-width(1)"/>
      <fo:table-column width="proportional-column-width(1)"/>
      <fo:table-column width="proportional-column-width(1)"/>
      <fo:table-body>
      <fo:table-row>
      <fo:table-cell>
      </fo:table-cell>
      <fo:table-cell>
      <!-- place your table here -->
      </fo:table-cell>
      <fo:table-cell>
      </fo:table-cell>
      </fo:table-row>
      </fo:table-body>
      </fo:table>

      Chris
    • Victor Vishnyakov
      The most accurate solution is to put the whole table into the inline container. Thus parent block s text-align and text-align-last atrributes with value center
      Message 2 of 5 , Sep 3, 2004
      • 0 Attachment
        The most accurate solution is to put the whole table into the inline
        container. Thus parent block's text-align and text-align-last atrributes
        with value center would do what you want.

        Regards,
        Victor Vishnyakov



        > -----Original Message-----
        > From: carlos mьller [mailto:carlorio_150@...]
        > Sent: Thursday, September 02, 2004 10:27 AM
        > To: XSL-FO@yahoogroups.com
        > Subject: [XSL-FO] table align center
        >
        >
        > How Can I align a table at center horizontally? I don´t know
        > the size of her
        > in design time.
      • Chris Bowditch
        ... The only trouble with this solution is that most Formatters dont yet implement fo:inline-container. Chris
        Message 3 of 5 , Sep 3, 2004
        • 0 Attachment
          Victor Vishnyakov wrote:

          > The most accurate solution is to put the whole table into the inline
          > container. Thus parent block's text-align and text-align-last atrributes
          > with value center would do what you want.

          The only trouble with this solution is that most Formatters dont yet implement
          fo:inline-container.

          Chris
        • Chris Bowditch
          ... I realised that I made a couple of mistakes in my sample: width on should have been column-width and the middle should
          Message 4 of 5 , Sep 3, 2004
          • 0 Attachment
            Chris Bowditch wrote:

            > carlos müller wrote:
            >
            > > How Can I align a table at center horizontally? I don´t know the size of
            > > her
            > > in design time.
            >
            > To horizontally centre a table, place it inside an outer table like this:
            >
            > <fo:table table-layout="fixed">
            > <fo:table-column width="proportional-column-width(1)"/>
            > <fo:table-column width="proportional-column-width(1)"/>
            > <fo:table-column width="proportional-column-width(1)"/>
            > <fo:table-body>
            > <fo:table-row>
            > <fo:table-cell>
            > </fo:table-cell>
            > <fo:table-cell>
            > <!-- place your table here -->
            > </fo:table-cell>
            > <fo:table-cell>
            > </fo:table-cell>
            > </fo:table-row>
            > </fo:table-body>
            > </fo:table>

            I realised that I made a couple of mistakes in my sample:

            width on <fo:table-column> should have been column-width

            and the middle <fo:table-column> should not have a column-width specified to
            allow the column to be big enough for the inner table.

            Chris
          Your message has been successfully submitted and would be delivered to recipients shortly.