xsl-list
[Top] [All Lists]

[xsl] dynamic fo:table-column width?

2007-05-30 07:30:57
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


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>