Posted By

walepinski on 07/08/06


Tagged

tables strip jquery


Versions (?)

Who likes this?

12 people have marked this snippet as a favorite

jonbaer
jkochis
bartekk
francisre
heinz1959
kristin
martingoldszein
esquareda
Hollow
seanpowell
guo3823538
wirenaught


[ jQuery ] StripTables


 / Published in: JavaScript
 

StripTables Script. Need jQuery Framework : http://jquery.com/

  1. function stripTables(){
  2. // select all table elements, select all tr elements and apply the css { background : color }
  3. $('table').find("tr:odd").css({ background : "#f6f6f6" });
  4. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Snowalker on December 5, 2011

you can use also:

$('table').not('tr:even').css('background', '#f6f6f6');

You need to login to post a comment.