/ Published in: jQuery
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
// 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>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                