[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Alternate row color


Subject: RE: [xsl] Alternate row color
From: Tham Tinh <khautinh@xxxxxxxxx>
Date: Fri, 10 Jan 2003 13:46:07 -0800 (PST)

It works.  That was great!
--- John Pallister <jpallister@xxxxxxxxxxxx> wrote:
> 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
> 


=====
"It is essential to know that to be a happy person, a happy family, a happy society, it is very crucial to have a good heart, that is very crucial,"
Dalai Lama

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread