This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: counter in xsl
- From: "David B. Bitton" <david at codenoevil dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 08 Feb 2002 09:40:16 -0500
- Subject: RE: [xsl] counter in xsl
- Organization: Code No Evil, LLC
- Reply-to: xsl-list at lists dot mulberrytech dot com
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