Greetings. I'm fairly new to XSLT and I have a problem.
I have a page that includes the following nodes:
<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 $colCount = 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>
These nodes display an index of departments at the top of a larger page.
Currently they display simply as a very long vertical list.
I need them to display in 5 columns like this:
Dept1 Dept5 Dept9 Dept13 Dept17
Dept2 Dept6 Dept10 Dept14 Dept18
Dept3 Dept7 Dept11 Dept15 Dept19
Dept4 Dept8 Dept12 Dept16 Dept20
I saw this thread:
http://p2p.wrox.com/topic.asp?TOPIC_...hTerms=columns which I think addresses the issue, but I must admit that I wasn't able to follow it.
Any help would be appreciated.