Re: [xsl] Alternating Colors For Table Rows

Subject: Re: [xsl] Alternating Colors For Table Rows
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Thu, 21 Jun 2001 13:34:34 -0400
Hmm, looks like my explanatory table got wrapped, at least in my email
client.  Let me try it again:

> Simple, eh?  Here's how it works.  Say n=3.  then
>
 position()    position() mod $n   position() mod (2$n)
 0                     0                            0
 1                      1                             1
 2                      2                            2
 -----------------------------------------------------------
 3                      0                            3
 4                      1                            4
 5                      2                            5
 ---------------------------------------------------------
 6                      0                            0
 7                      1                             1
 8                      2                             2
---------------------------------------------------------
 9                      0                             3
 etc.

> See how it works?
>
> In practice, position() is 1-based, not zero-based, so you have to use
> (position()-1).  In fact, I found that I actually had to use
> number(position()) -1.
>

Sorry about the earlier one.

Cheers,

Tom P


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


Current Thread