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

Re: Dynamic column widths on table cells

Subject: Re: Dynamic column widths on table cells
From: "Tony Graham" <tgraham@xxxxxxxxxx>
Date: Mon, 21 Oct 2013 22:51:42 +0100 (IST)
Re:  Dynamic column widths on table cells
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@xxxxxxxxxx
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.