XSLT
XSLT Contents
Summary To display the background color of every odd row in a table in a different color you need to use the XPath position() function. This achieved using the mod operator.
To our <td> element we are going to add the bgcolor element to be silver if the mod operator returns false (0), which is achieved in the following code:<td><xsl:if test=position() mod 2><xsl:attribute name=bgcolor>silver</xsl:attribute></xsl:if>
The HTML output for this transformation looks as follows:
Partners
Dream.In.Code dotNet Slackers dotNet Spider Your HTML Source VisualBuilder.com DevGuru Planet Source Code ZVON.ORG Web Design ASPAlliance XML Pitstop Scripts
The Spot 4 SAP Bitshop Web Hosting