Re: Implementing a multi-column list
David Carlisle <[email protected]> Tue, 3 Dec 2002 16:43:44 GMT
| Newsgroups | gmane.text.xml.xsl.general |
|---|---|
| Message-ID | <[email protected]> |
If your list will always fit on one page it sounds like you can just make a table. I think your input is something like <list cols="3"> <item>111</item> <item>111</item> <item>111</item> </list> > I need to count the number of items in the list and divide it by the > number of columns they specified <xsl:variable name="n" select="ceiling(count(item) div @cols"/> <xsl:for-each select="item[position() <= $n]"> <row> <xsl:for-each select=".|following-sibling::item[position() mod $n = 0]"> <cell> <xsl:value-of select="."/> </cell> </xsl:for-each> </row> </xsl:for-each> (with suitable FO replacements for <row and <cell David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service.