Yes, I know that this is off-topic, but I haven't been able to find info on this anywhere else, so I go to what I consider the most reliable knowledge source I know... PM.

I'm fairly new to XSLT and 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 $c +olCount = 1]"> <xsl:element name="tr"> <xsl:apply-templates select=". | following-sibling::pcr_report +/info/department[position() &lt; $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've googled 'till I just can't google no more, and I've come up wish zilch.

Anyone know how to do this?


In reply to OT - Dynamic data into columns in XSLT by rashley

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.