[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Table columns - fixed span width with underlying

Subject: Re: Table columns - fixed span width with underlying "auto" layout columns
From: "Murray McDonald" <m.mcdonald@xxxxxxxxx>
Date: Wed, 23 Feb 2011 21:30:52 -0500
Re:  Table columns - fixed span width with underlying
Hi Brandon,

Thanks very much for your response.

Yes aligning on a zero-width character is a great idea for that part of my
problem -- always disappointing when your vendor doesn't support a feature
you need!

To clarify, my existing XSLT calculates the width of each column.  It's a
multi-pass process and I can easily add a pass to determines if a numeric
column has one or more cells whose text content ends with ")", "%", or
"%)".  (Its also possible there might be footnote "reference labels" that I
would want to hang as well but that doesn't really change the nature of the
problem).  Using a hidden inline with the right data conent will allow me to
align the numerics -- so if my "maximum hang" is ")%" then cells in that
column with neither would get a hidden inline with "%)", cells ending with
")" would get a hidden inline with "%", cells ending with "%" would get a
hidden inline with ")", cells ending with "%)" would not get the hidden
inline.  So that takes care of the alignment part of my problem.

I still need to deal with the underline part of the problem.  The length of
the underline that should be used throughout the column is determined by the
widest data entry (excluding any data that hangs) That's why I was thinking
of "splitting" these columns into 3 columns, one  to  hold any content that
needs to hang, one to hold (and right-align) the numeric data and also
correctly "size" the underlines, and the leftmost column to pad the whole
thing out to the calculated width.

What I would like to be able to do with XSL-FO is tell it "these three
columns should in total be X points wide - the two rightmost columns should
be no wider than required to accomodate the widest entry and the leftmost
column should be sized as X minus the total width of the other two columns".

I'm think I will try using your suggestion to solve my "hanging" issue and
use the "InnodataSaxonExtensions" to calculate the maximum width of the
"numeric" for a column in order to determine the size of the underline. 
That will allow me to use a single right-aligned column.

I wasn't looking forward to figuring out how to split these columns into
multiple columns anyway :-)

On 23/02/2011 7:45 PM, Brandon Ibach wrote:

The most elegant solution I can think of would be to use the
text-align="<string>" property to align the numeric values on a
zero-width space between the final digit and any "%" or ")", but the
documentation on XEP indicates that it doesn't support that feature.

The next best choice would probably be the multi-column solution, only
I think you should be able to do it with just two columns, as I don't
see the need for the one to the left.  I'm not completely clear on how
you're doing the layout, though.  Is your XSLT calculating fixed
widths for each column, or are you relying on XEP to do auto-layout?

I can think of one other option that might work, though it is a bit of
a hack.  Pre-scan the content in your XSLT to determine if any entries
will need a "%", a ")" or both.  Then, while generating each entry,
add any of those symbols not needed by that entry in an<fo:inline
visibility="hidden">  at the end.  Combined with text-align="right" on
the block (and possibly a keep-together to make sure there's no
wrapping), this should reserve the needed space to line everything up.

-Brandon :)

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.