Use XSLT to arrange a list of items in a table
Posted
by Mark Sp
on Stack Overflow
See other posts from Stack Overflow
or by Mark Sp
Published on 2010-03-29T09:29:35Z
Indexed on
2010/03/29
9:33 UTC
Read the original article
Hit count: 320
I have a linear list of items which I wish to arrange in a table using XSLT. I wish to specify the number of columns as a parameter. For example, if I have a list of 12 items, I can select a 2x6, 3x4, 4x3 or 6x2 table. I cannot see a general way to do this.
I have seen this article: http://www.nedcomp.nl/support/origdocs/xml4/extracted/xpath_hdi_1_4llx.aspx
It tells you how to generate a table with a specific number of columns, but does not allow a general case. (Ideally there would be a loop for the xsl:value-of lines).
Thanks
Mark
© Stack Overflow or respective owner