[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Alternate row color

Subject: RE: Alternate row color
From: John Pallister <jpallister@xxxxxxxxxxxx>
Date: Fri, 10 Jan 2003 16:34:54 -0500
alternate row style xsl
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
  • Alternate row color
    • Tham Tinh - Fri, 10 Jan 2003 15:30:16 -0500 (EST)
      • <Possible follow-ups>
      • John Pallister - Fri, 10 Jan 2003 16:24:39 -0500 (EST) <=
        • Tham Tinh - Fri, 10 Jan 2003 16:45:24 -0500 (EST)

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.