This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: counter in xsl


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@lists.mulberrytech.com 
> [mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of 
> thenewmatrix@genie.it
> Sent: Friday, February 08, 2002 4:35 AM
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]