I’m working on putting some of my most often used jQuery snippets onto SKFox.com. Here is my first such attempt. Table striping makes data easier to read and jQuery has some great selectors for this.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('table.zebra thead > tr:first-child()').addClass('zSelected'); | |
$('table.zebra tbody > tr:nth-child(odd)').addClass('zOdd'); | |
$('table.zebra tbody > tr:nth-child(even)').addClass('zEven'); |
Be sure to check out the table striping demo page and view the source to see the small amount of CSS and javascript it takes to make your tables pop for your users.
UPDATE: jQuery 1.4 offers us a new way to stripe tables.
Is it possible to print the pages with striping?
When you print the table the striping is lost.
Is it possible to print with the applied classes?
why you doing provide the classes?