[jQuery] Re: Column highlite

2009-01-19 Thread Liam Potter
Ahh, I just asumed he wanted zebra striped rows, didn't really pay attention to the thread title. brian wrote: Using children() would be better than find() but your suggestion would skip every other row. $('#your_table_id tr').children('td:odd').css('background-color', '#EEE'); Better, agai

[jQuery] Re: Column highlite

2009-01-19 Thread brian
Using children() would be better than find() but your suggestion would skip every other row. $('#your_table_id tr').children('td:odd').css('background-color', '#EEE'); Better, again: $('#your_table_id tr').children('td:odd').addClass('SomeClassName'); On Mon, Jan 19, 2009 at 10:55 AM, Liam Pot

[jQuery] Re: Column highlite

2009-01-19 Thread Liam Potter
$('#your_table_id tr:odd').children('td').css('background-color', '#EEE'); brian wrote: $('#your_table_id tr').find('td:odd').css('background-color', '#EEE'); You need to operate on each TR separately or jQuery will count each TD without regard for the row it's in. On Sun, Jan 18, 2009 at 1

[jQuery] Re: Column highlite

2009-01-18 Thread Mauricio (Maujor) Samy Silva
$('tr td:nth-child(2n)').css('background', '#ccc') // even column highlited $('tr td:nth-child(2n-1)').css('background', '#ccc') // odd column highlited MaurĂ­cio -Mensagem Original- De: Para: "jQuery (English)" Enviada em: segunda-feira, 19 de janeiro de 2009 01:32 Assunto: [jQuery

[jQuery] Re: Column highlite

2009-01-18 Thread brian
$('#your_table_id tr').find('td:odd').css('background-color', '#EEE'); You need to operate on each TR separately or jQuery will count each TD without regard for the row it's in. On Sun, Jan 18, 2009 at 10:32 PM, wrote: > > I have table which need to have alternate column highlight and work in