Subject: RE: [xsl] Alternate row color From: John Pallister <jpallister@xxxxxxxxxxxx> Date: Fri, 10 Jan 2003 16:34:54 -0500 |
Try this instead... <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:template match="/"> <html> <STYLE> TR.clsOdd { background-Color: #feeded; } TR.clsEven { background-color: #beefee; } </STYLE> <head> </head> <body> <p> <center> <table> <tr> <th>Client Number</th> <th>Client Name</th> <th>Client SSN</th> <th>Relationship Description</th> </tr> <xsl:apply-templates select="Data"/> </table> </center> </p> </body> </html> </xsl:template> <xsl:template match="data1"> <tr> <xsl:choose> <xsl:when test="position() mod 2 = 1"> <xsl:attribute name="class">clsOdd</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class">clsEven</xsl:attribute> </xsl:otherwise> </xsl:choose> <td><xsl:value-of select="./info1/clnum"/></td> <td><xsl:value-of select="./info1/clname"/></td> <td><xsl:value-of select="./info1/ssn"/></td> <td><xsl:value-of select="./info1/rel_desc"/></td> </tr> </xsl:template> </xsl:stylesheet> Hope that helps, John Pallister XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Alternate row color, Wendell Piez | Thread | RE: [xsl] Alternate row color, Tham Tinh |
[xsl] using variable in mode attrib, Long Zhao | Date | RE: [xsl] using variable in mode at, Michael Kay |
Month |