I should have pointed out that the first and third columns can both have
more than two lines, and that I can't guarantee both columns will have
the same number of lines. 

Here's what I'm currently trying; this is a greatly simplified test:

<?xml version="1.0"?>
<root xmlns="http://www.w3.org/1999/XSL/Format";>
  <layout-master-set>
    <simple-page-master page-height="11in" page-width="8.5in"
margin-left="1in" margin-right="1in" margin-top="2in"
margin-bottom="2in" master-name="foo">
      <region-body/>
    </simple-page-master>
  </layout-master-set>
  <page-sequence master-reference="foo">
    <flow flow-name="xsl-region-body">
      <table table-layout="fixed">
        <table-column column-width="1.5in" number-columns-repeated="3"/>
        <table-body display-align="after">
          <table-row>
            <table-cell>
              <block>Here is some really long text for testing.</block>
            </table-cell>
            <table-cell>
              <block>99999</block>
            </table-cell>
            <table-cell>
              <block-container overflow="hidden" wrap-option="no-wrap">
                <block>And now for some more text.</block>
              </block-container>
            </table-cell>
          </table-row>
          <table-row>
            <table-cell column-number="3">
              <block-container overflow="hidden"
text-indent="-from-table-column(column-width)">
                <block>And now for some more text.</block>
              </block-container>
            </table-cell>
          </table-row>
          <table-row>
            <table-cell>
              <block>foo</block>
            </table-cell>
            <table-cell>
              <block>88888</block>
            </table-cell>
            <table-cell>
              <block>Some text.</block>
            </table-cell>
          </table-row>
        </table-body>
      </table>
    </flow>
  </page-sequence>
</root> 


This is close to what I need, but it has two problems:
1) In the first table-row, the text in the third column gets clipped in
the middle of a letter during my testing, which is obviously
undesirable.
2) This method works only if you can generate the extra table-row for a
given entry only when needed. I tried the empty-cells="hide" property on
that extra row, but the spec says hide works only when there is no
visible content, which they define as being completely empty or
containing only whitespace. If you shorten the text going into the third
column, you'll see the extra row still appears even though it contains
nothing that prints on the page.

I wish there was some way to determine if a particular block was going
to wrap, or to specify that only N lines of a wrapped block should be
displayed.


Eric Amick
Legislative Computer Systems
Office of the Clerk

-----Original Message-----
From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 15, 2008 16:40
To: fop-users@xmlgraphics.apache.org
Subject: Re: Text Formatting Problem

On Jan 15, 2008, at 18:03, Amick, Eric wrote:

Hi

> I have a three-column listing of phone numbers, and most of the time, 
> each column entry has only one line of text. Sometimes, however, I 
> have entries that look like this:
>
> Text that spans
>     two lines ...........  99999   More text that
>                                              spans two lines
>
> In case the format gets garbled, the number in the second column 
> should line up with the last line of text in the first column and the 
> first line of text in the third column. I've tried using display-align

> and vertical-align, but I can't come up with a way that works. Does 
> anyone have any suggestions?

Can you post the FO-snippet you currently have?

I was thinking something like (only works in case you always have three
lines, and they're all in the same font-size):

<fo:table>
   <fo:table-column column-width="proportional-column-width(2)" />
   <fo:table-column column-width="proportional-column-width(1)" />
   <fo:table-column column-width="proportional-column-width(2)" />
   <fo:table-body>
     <fo:table-cell starts-row="true" display-align="before">
       <fo:block>Text that spans two lines ...... </fo:block>
     </fo:table-cell>
     <fo:table-cell display-align="center">
       <fo:block>99999</fo:block>
     </fo:table-cell>
     <fo:table-cell ends-row="true" display-align="after">
       <fo:block>More text that spans two lines</fo:block>
     </fo:table-cell>
   </fo:table-body>
</fo:table>


Another way to achieve something similar, would be by means of
fo:block-containers (implemented) or fo:inline-containers
(unimplemented, but being worked on). The display-align properties do
not apply to fo:block or fo:inline. Maybe that's the reason why it
doesn't work for you (? remote guess)

HTH!


Cheers

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to