rashley has asked for the wisdom of the Perl Monks concerning the following question:
I'm fairly new to XSLT and have a problem.
I have a page that includes the following nodes:
These nodes display an index of departments at the top of a larger page.<xsl:template name="deptIndex"> <xsl:variable name="colCount" select="3"/> <xsl:element name="p"> Department Index </xsl:element> <xsl:element name="table"> <xsl:for-each select="pcr_report/info/department[position() mod $c +olCount = 1]"> <xsl:element name="tr"> <xsl:apply-templates select=". | following-sibling::pcr_report +/info/department[position() < $colCount]" mode="deptIndexTD"/> </xsl:element> </xsl:for-each> </xsl:element> </xsl:template> <xsl:template match="department" mode="deptIndexTD"> <xsl:element name="td"> <xsl:element name="a"> <xsl:attribute name="href"> <xsl:value-of select="concat('#', .)"/> </xsl:attribute> <xsl:value-of select="."/> </xsl:element> </xsl:element> </xsl:template>
Currently they display simply as a very long vertical list.
I need them to display in 5 columns like this:
I've googled 'till I just can't google no more, and I've come up wish zilch.Dept1 Dept5 Dept9 Dept13 Dept17 Dept2 Dept6 Dept10 Dept14 Dept18 Dept3 Dept7 Dept11 Dept15 Dept19 Dept4 Dept8 Dept12 Dept16 Dept20
Anyone know how to do this?
|
|---|