Luke Jones wrote:
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.
One way to do it might be to wrap the content of the column you want to
be dynamic within fo:inline with a keep-together.within-line="always".
This should disallow breaking of the line. By then using automatic table
layout, you should get what you want, at least for that line.
Another solution is to create an XSLT extension function that can
estimate the rendered length of the content and then use that estimate
to set the column width. I've done this in Java using the standard Java
graphics API. It requires that you know the current font and font size
(which presumably you can know if you're generating the output), but the
programming was relatively easy, if memory serves (I don't have the code
to hand).
Otherwise there is direct way to do what you want.
Cheers,
Eliot
--
W. Eliot Kimber
Professional Services
Innodata Isogen
8500 N. Mopac, Suite 402
Austin, TX 78759
(214) 954-5198
ekimber(_at_)innodata-isogen(_dot_)com
www.innodata-isogen.com
--~------------------------------------------------------------------
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>
--~--