[jQuery] Re: paint columns in alternating colour

2009-01-29 Thread kevind
$("table.Grid tr td:nth-child(even)").css("background","gainsboro"); this did the trick - figured it out myself (ok, i read it in the zebra striping tutorial at jquery.com and figured it would work for columns too) thanks all

[jQuery] Re: paint columns in alternating colour

2009-01-28 Thread bret ferrier
kevin you need to try $("table.Grid tr td:even").css("background","silver"); From: kevind To: jQuery (English) Sent: Wednesday, January 28, 2009 9:59:20 AM Subject: [jQuery] paint columns in alternating colour i have this table structure - a database feeds ro

[jQuery] Re: paint columns in alternating colour

2009-01-28 Thread Liam Potter
no wonder it didn't work, .Row is only on captions, try this $(document).ready(function(){ $("table.Grid tr:even td").each().addClass("colouredtd"); }); I did mean to leave spaces yes, you write the selector just like you would with CSS. kevind wrote: i added it thus:

[jQuery] Re: paint columns in alternating colour

2009-01-28 Thread kevind
forgot to say, it didn't work :(

[jQuery] Re: paint columns in alternating colour

2009-01-28 Thread kevind
i added it thus: $(document).ready(function(){ $(".Grid .Row:even td").each().addClass("colouredtd"); }); style on page= .colouredtd {background:silver;} Did you mean to leave a space between .Grid and .Row

[jQuery] Re: paint columns in alternating colour

2009-01-28 Thread Liam Potter
if you have to have the background color on the td use this $(document).ready(function(){ $(".Grid .Row:even td").each().css("background","silver"); }); if you can put the background color on the tr instead and leave the td transparent it's just this $(document).ready(function(){ $(".Grid .Ro