This sample shows how to set up various row coloring schemes with the Element Selector.
There is another sample that shows how to set up row colors with Spry Data.
Spry.$$("table#noheader tr:nth-child(even)").addClassName("grayBG");
or
Spry.$$("table#noheader tr:nth-child(2n)").addClassName("grayBG");
1 |
2 |
3 |
4 |
5 |
6 |
Spry.$$("table#noheader tr:nth-child(2n+1)").addClassName("grayBG");
Header |
---|
1 |
2 |
3 |
4 |
5 |
6 |
Spry.$$("table#noheader tr:nth-child(odd)").addClassName("grayBG");
or
Spry.$$("table#noheader tr:nth-child(2n)").addClassName("grayBG");
1 |
2 |
3 |
4 |
5 |
6 |
Spry.$$("table#withheaderodd tr:nth-child(2n)").addClassName("grayBG");
Header |
---|
1 |
2 |
3 |
4 |
5 |
6 |
Spry.$$("table#alternating tr:nth-child(2n)").addClassName("grayBG");
Spry.$$("table#alternating tr:nth-child(2n+1)").addClassName("highlited");
1 |
2 |
3 |
4 |
5 |
6 |
Spry.$$("table#alternating tr:nth-child(2n)").addClassName("grayBG");
Spry.$$("table#alternating tr:nth-child(2n+1)").addClassName("highlited");
Spry.$$("table#alternating3 tr:nth-child(3n+3)").addClassName("red");
1 |
2 |
3 |
4 |
5 |
6 |