[ACCEPTED]-XSL FO inline alignment-xsl-fo

Accepted answer
Score: 46

Elegance wasn't a stated requirement, but 9 this should fit the bill:

<fo:block text-align-last="justify">
  LEFT TEXT
  <fo:leader leader-pattern="space" />
  RIGHT TEXT
</fo:block>

This works by justifying 8 the last line of text in the block, so that 7 the text begins at the left of the line 6 and ends at the right. The leader, which 5 is usually used on Table of Contents pages, stretches 4 to fill the space between the left and right 3 text. Normally it is used as <fo:leader leader-pattern="dots" />, which produces 2 a stretch of periods, but in this case it 1 merely provides a gulf of space.

Score: 12

This will do the trick:

<fo:table>
  <fo:table-column />
  <fo:table-column />

  <fo:table-body>
    <fo:table-row>
      <fo:table-cell>
        <fo:block>LEFT TEXT</fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block text-align="right">RIGHT TEXT</fo:block>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-body>
</fo:table>

0

Score: 5
<fo:inline-container vertical-align="top" inline-progression-dimension="49.9%">
    <fo:block>left content</fo:block>
</fo:inline-container>
<fo:inline-container vertical-align="top" inline-progression-dimension="49.9%">
    <fo:block>right-content</fo:block>
</fo:inline-container>

Verified working with FOP 2.0

0

Score: 0

I dont't have the time right now to test 5 this but check out http://www.w3.org/TR/xsl/#fo_float

float one right float 4 the other left - i'd give it a shot if I 3 was looking to do what you are describing

you 2 could also use a table

unless by aligned 1 right AND left you mean justified...

Score: 0

I create two blocks and on the second block 3 I set this attribute:

margin-top="-4mm"

or what your font size 2 and margin bottom are (just to look like 1 they are on same line)

More Related questions