I'm using this code hightlight any table cell in the 12th column with a value of zero which works well.
//SharesHeld jQuery('#Directorships tr').each(function() { jQuery('#Directorships td:nth-child(12)').filter(function() { if (jQuery(this).text() == 0) jQuery(this).addClass("bgHighlight"); }); }); I need to make this a bit more complex by hightlighting any table cell in the 12th column with a value of zero except those rows with a value of 'Retired' in the 7th column. I tried this approach below but if any value in the 7th column has a value of 'Retired' then none of the cells in the 12th get highlighted. I need to to evaluate it on a row- by-row basis rather than the entire column. In other words, I just want to exclude anyone who is retired. //SharesHeld jQuery('#Directorships tr').each(function() { jQuery('#Directorships td:nth-child(12)').filter(function() { if ((jQuery(this).text() == 0) && ('#Directorships td:nth-child (7)').not(':contains("Retired")')) jQuery(this).addClass("bgHighlight"); }); }); In this example, the first 2 zeros in the 1st and 2nd rows should be highlighted but the third one should not be. Column7 Column12 Active 0 (highlighted) Active 0 (highlighted) Retired 0 (not highlighted) Thanks