Re: [jQuery] Changing background color of table cells

2009-12-05 Thread Karl Swedberg
I'd try something like this: $('#Directorships td:nth-child(1)').filter(function() { return $(this).text() == 'D'; }).addClass('bgHighlight'); Change the 1 in :nth-child(1) to whatever column you want. nth-child is 1-indexed, so the first cell in a row would be :nth-child(1), the second :n

[jQuery] Changing background color of table cells

2009-12-05 Thread evanbu...@gmail.com
I have a table with an id of Directorships and I want to add the class bgHighlight to any cell with a value of 'D'. This code below works fine for an entire table but I just want to apply this logic to a single column of the same table rather than the whole table. Thanks. $('#Directorships tr').e