| Author |
Generalized table striping using JQuery
|
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
Is there a way to generalize this kind of JQuery trick:
to add a class to, say, every third or fourth row of a table, rather than every second row?
|
[Jess in Action][AskingGoodQuestions]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56196
|
|
|
Have you considered the nth-child:Xn+Y form of selector?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
|
Thanks, Bear, that works perfectly -- I had no idea such a thing was in there.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56196
|
|
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
With CSS3 enabled browsers, you do not even need to use jQuery. That would be a big performance gain.
Eric
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56196
|
|
|
Unfortunately, not everyone is using modern browsers. Microsoft keeps threatening to instill auto-upgrades a la Chrome and Firefox, but it hasn't happened yet.
|
 |
 |
|
|
subject: Generalized table striping using JQuery
|
|
|