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

239Re: [XSL-FO] align text left, center and right on same line

Expand Messages
  • MURAKAMI Shinyu
    Mar 1, 2001
    • 0 Attachment
      hakan.lindestaf@... wrote:
      > I'm fairly new to XSL-FO, but I seem to get how it works. But there
      > is one thing that I can't seem to solve. I'm using Antenna XSL
      > Formatter and I'm trying to have a page header like this:
      > Left Text Center Text Right Text
      >
      > I found some examples here that suggested leaders, that works, but
      > not perfectly. For example the position of the center text is based
      > on the length of the left and right texts, and I want it exactly in
      > the middle.
      >
      > The example in the XML Bible on the net suggested multiple fo:inline
      > which I thought made sense, but it doesn't work, everything is
      > aligned to left (or withever alignment comes first).

      the XML Bible...
      http://www.ibiblio.org/xml/books/bible/updates/15.html#Inlines

      This example is wrong: text-align property cannot apply to fo:inline!!

      You can use fo:inline-container instead of fo:inline :

      <fo:block>
      <fo:inline-container inline-progression-dimension="33.3%">
      <fo:block text-align="start">
      Left Text
      </fo:block>
      </fo:inline-container><fo:inline-container inline-progression-dimension="33.3%">
      <fo:block text-align="center">
      Center Text
      </fo:block>
      </fo:inline-container><fo:inline-container inline-progression-dimension="33.3%">
      <fo:block text-align="end">
      Right Text
      </fo:block>
      </fo:inline-container>
      </fo:block>

      Or use fo:table :

      <fo:table table-layout="fixed" inline-progression-dimension="100%">
      <fo:table-column column-width="33.3%"/>
      <fo:table-column column-width="33.3%"/>
      <fo:table-column column-width="33.3%"/>
      <fo:table-body>
      <fo:table-row>
      <fo:table-cell>
      <fo:block text-align="start">
      Left Text
      </fo:block>
      </fo:table-cell>
      <fo:table-cell>
      <fo:block text-align="center">
      Center Text
      </fo:block>
      </fo:table-cell>
      <fo:table-cell>
      <fo:block text-align="end">
      Right Text
      </fo:block>
      </fo:table-cell>
      </fo:table-row>
      </fo:table-body>
      </fo:table>


      Hope this helps,

      Shinyu Murakami
    • Show all 7 messages in this topic