Alternate three and three rows in a table with jQuery

Posted by Frode Lillerud on Stack Overflow See other posts from Stack Overflow or by Frode Lillerud
Published on 2010-06-17T18:04:15Z Indexed on 2010/06/17 18:13 UTC
Read the original article Hit count: 304

Filed under:

I want to set the alternate background color for rows in a table - but the twist is that I don't want every other row to be colored, I want to treat them in blocks of three rows.

So for a table with eight rows I want the first three to be white, then the next three to have a background color, and the last two are back to white again.

How can I do this using jQuery?

© Stack Overflow or respective owner

Related posts about jQuery