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

Re: dynamic fo:table-column width?

Subject: Re: dynamic fo:table-column width?
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Wed, 30 May 2007 09:52:04 -0500
Re:  dynamic fo:table-column width?
Hi, Luke,

That's a question I've answered before on a different mailing list. It took me a bit to find my previous message (if I hadn't known I'd written it, I never would have found it).

Here's a link to that old answer: http://marc.info/?l=fop-user&m=112732887606348&w=2

It works, but it relies on a longish bit of easy-to-misunderstand code, so it may not be a worthwhile solution. Still, it may give you an idea for your own, better solution.

HTH

Jay Bryant
Bryant Communication Services



----- Original Message ----- From: "Luke Jones" <ljones@xxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, May 30, 2007 9:30 AM
Subject: dynamic fo:table-column width?



XSL Experts,

I'm trying to create a dynamic table where the columns are based off of
the length of the longest string that the cell will hold.  An example
will probably be the best way to explain.

Say I have the following xml document:

<tbl>
<r>
<c1>73-123</c1>
<c2> Chapter XX-XXX for legal docs</c2>
</r>
<r>
<c1>73-1,453 and 73-1,454</c1>
<c2> Chapter XX-XXX for legal docs</c2>
</r>
</tbl>

< para and chapter information .... blah blah blah />

<tbl>
<r>
<c1>74-056</c1>
<c2> Chapter XX-XXX for legal docs</c2>
</r>
<r>
<c1>74-324</c1>
<c2> Chapter XX-XXX for legal docs</c2>
</r>
</tbl>

<para and chapter information .... blah blah blah />


Currently I have fixed column-widths, so my tables look like:


73-123                        Chapter XX-XXX for legal docs
73-1,453 and 73-1,454         Chapter XX-XXX for legal docs

para and chapter information...

74-056                        Chapter XX-XXX for legal docs
74-324       Chapter XX-XXX for legal docs

para and chapter information...

However, I would like the column widths to be based off of the longest
string within the c1 column plus 2 spaces.  This would make the tables
look like:

73-123                 Chapter XX-XXX for legal docs
73-1,453 and 73-1,454  Chapter XX-XXX for legal docs

para and chapter information...

74-056  Chapter XX-XXX for legal docs
74-324 Chapter XX-XXX for legal docs

para and chapter information...

So the content of the cells effects the size of the columns.  Is what
I'm wanting to do possible?  I've done some searching and haven't found
anything that addresses this problem specifically.  Any ideas or input
is greatly appreciated.

Thanks,
Luke

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.