On Mon, October 21, 2013 8:03 pm, KAATMAN Matthew wrote:
Is it possible to have columns adjust their width based on the length of
the content?
If your FO processor supports automatic table layout (and you haven't
forced fixed table layout [1]), then it should just work.
I've got a situation where the right header is quite a bit longer than the
left. I'd like it to use up the available space instead of wrapping when
possible. (This example is set to 50/50 column width.)
http://i.imgur.com/bgCMJYB.png
If there's no way to automatically do it, can I manually do it based on
content length?
Making decisions based on formatted sizes is the what we're trying to
solve at http://www.w3.org/community/ppl/wiki/FOPRunXSLTExt
If column one was 20 chars and column 2 was 40, set them to
proportional-column-width(1) and proportional-column-width(2) for example.
For that, you do need fixed table layout [2].
Using the lengths of the two strings should work most of the time. Of
course 20 'W' is more than likely wider than 40 'i', but I doubt you'd use
either of those as your header text.
Another option is to discard the table and use a fo:leader between the two
strings to keep them maximally apart.
Regards,
Tony Graham tgraham(_at_)mentea(_dot_)net
Consultant http://www.mentea.net
Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
XML, XSL-FO and XSLT consulting, training and programming
Chair, Print and Page Layout Community Group @ W3C
[1] http://www.w3.org/TR/xsl11/#fo_table
[2] http://www.w3.org/TR/xsl11/#d0e5961
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--