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

RE: counter in xsl

Subject: RE: counter in xsl
From: "David B. Bitton" <david@xxxxxxxxxxxxxx>
Date: Fri, 08 Feb 2002 09:40:16 -0500
xsl row counter
You can't, but this is how you can implement alternating row color (as
this is how I do it).  In your for-each, do this...

<xsl:for-each ... >
	<tr class="row{position() mod 2}">
		...
	</tr>
</xsl:for-each>

Now, each odd row is class="row1" and each even row is class=row0".  The
only this left to do is define these classes in a CSS style block or
sheet, like so:

<style>
	.row1 { background-color:green; color:white }
	.row0 { background-color:white; color:black }
</style>

The { and } work almost like an eval statement would (almost). :)

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> thenewmatrix@xxxxxxxx
> Sent: Friday, February 08, 2002 4:35 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  counter in xsl
> 
> 
> How can i create a counter into xsl due to insert alternate 
> color in table-row???
> 
> Thanks.
> 
> Connettiti con Genie.it e vinci una fantastica Mini! E' 
> facile clicca qui http://www.genie.it/geniemini
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


Current Thread

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.