views:

21

answers:

1

Ok, math isn't my strong side, I admit it.

All I want to do is to select the first, 5th, 9th, 13th, 17th etc row in a html-table. Can anybody with better math-skills point me in the right directionor perhaps supply a "nth-child-for-dummies" guide?

I tried nth-child(1n+4) (which selects the 4th row and everyone after), and i also tried nth-child(0n+4) which selects the fourth row and nothing after that.

Thanks in advance.

+2  A: 

Shoulb be something like

    tr:nth-child(4n+1) {
      declarations
}
Mauro
So that n = 0 ==> 4 * 0 + 1 = 1n = 1 ==> 4 * 1 + 1 = 5n = 2 ==> 4 * 2 + 1 = 9ans so on...
Mauro
Awesome, thank you. Think i understand the automaical workings behind it now...
Nils