/ Published in: jQuery
                    
                                        
This one is simple yet very useful. You can do alternating row colors with 2 simple lines of jQuery
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
//jquery
$('div:odd').css("background-color", "#F4F4F8");
$('div:even').css("background-color", "#EFF1F1");
//html example
<div>Row 1</div>
<div>Row 2</div>
<div>Row 3</div>
<div>Row 4</div>
//you can use td, tr, li, etc..
URL: http://www.codespuds.com/jquery-alternating-row-colors/
Comments
 Subscribe to comments
                    Subscribe to comments
                
                