Return to Snippet

Revision: 23711
at February 11, 2010 15:13 by bradless


Initial Code
// jQuery
$(function(){
  $("tr.stripe:even").css("background-color", "#D0D0D0");
  $("tr.stripe:odd").css("background-color", "#E5E5E5");
}


// HTML
<table>
   <tr class="stripe">
     <td>Col 1</td>
     <td>Col 2</td>
     <td>Col 3</td>
   </tr>
   <tr class="stripe">
     <td>Col 1</td>
     <td>Col 2</td>
     <td>Col 3</td>
   </tr>
   <tr class="stripe">
     <td>Col 1</td>
     <td>Col 2</td>
     <td>Col 3</td>
   </tr>
</table>

Initial URL


Initial Description


Initial Title
Alternate Row Colors / Zebra Striping with jQuery

Initial Tags
jquery, background, color

Initial Language
jQuery