Alternate coloring for Tables


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.