[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Alternating Colors For Table Rows
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|