Posted By

Sullan on 11/24/10


Tagged

jquery


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

rbulgueroni
rygiel


Alternate coloring for Tables


 / Published in: jQuery
 

  1. <script type="text/javascript">
  2. $( function()
  3. {
  4.  
  5. $( ".informationTable tr:nth-child(even)" ).addClass( "rowDark" );
  6.  
  7. $( ".informationTable tr:nth-child(odd)" ).addClass( "rowLight" );
  8.  
  9. $( ".informationTable th" ).addClass( "rowHeader" );
  10.  
  11. });
  12.  
  13. </script>

Report this snippet  

You need to login to post a comment.