jump to navigation

XSL – Apply styles to the last row in a table February 1, 2007

Posted by maxmil in : xsl , trackback

I recently needed to give special style treatment to the last row in a table formatted using xsl. Heres how i did it.

First i selected all the rows other than the last row and looped through them<xsl:variable name="totalRes" select="count(result)"/>
<xsl:for-each select="result[$totalRes>position()]">
...
</xsl:for-each>

An then selected the last element for special treatment<xsl:for-each select="result[last()]">
...
</xsl:for-each>

Comments»

no comments yet - be the first?