Return to Snippet

Revision: 39518
at January 18, 2011 03:59 by BlueIceStudios


Initial Code
//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..

Initial URL
http://www.codespuds.com/jquery-alternating-row-colors/

Initial Description
This one is simple yet very useful. You can do alternating row colors with 2 simple lines of jQuery

Initial Title
jQuery Alternating Row Colors

Initial Tags
jquery

Initial Language
jQuery