[xsl] Table columns - fixed span width with underlying "auto" layout columns

Subject: [xsl] Table columns - fixed span width with underlying "auto" layout columns
From: "Murray McDonald" <m.mcdonald@xxxxxxxxx>
Date: Wed, 23 Feb 2011 17:01:41 -0500
I am writing an XSLT to produce XSL-FO.  I am using the RenderX engine.

I have a table with a 5 columns.  The last four columns are columns of
numbers with text headers.  The XSLT can calcuate how wide it would like
each of these columns to be.  The numbers normally represent thousands of
dollars but are sometimes percentages and sometimes are enclosed within
parenthesis to indicate a debit.  The formatting requirement is to "hang"
any trailing close parenthesis or percent charcater (or both) such that the
last digit of each number aligns vertically.  On cells with a rowsep I also
need to include an underline or double-underline but the length of that
underline should only be as wide as the widest numeric entry within the
column.

One possibility might be to break each of these single columns into three
columns. The rightmost column would be to hold ")", "%" or %)" if present,
the fo:block in such a cell would use text-align="left".  The "middle"
column would hold the dollar figure and any open parenthesis; the fo:block
in such a cell would use text-align="right".   If an underline or double
underline is required it would be applied to this "middle" cell only.  The
leftmost column would be empty and would be used to "pad" the total span of
the three cells out to the desired width.  The column headers would span the
three cells.

I don't see anything in the specs that suggest this should work but I've
tested a number of solutions.  The best of these makes the first of the
three coumns the width I desired for all three and does get "minimum" widths
for my two rightmost columns but it expands the total width of the table by
the width of these two columns.

Looking at the FAQ and the archive, the most promising solution I can see it
to use the "InnodataSaxonExtensions" in the XSLT step to measure the text I
am setting and then used fixed table layouts.

If anyone has thoughts or comments on this I would appreciate hearing them.

Thanks very much

Current Thread