Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery highlight row based on specific column's value

Using jQuery, I would like to highlight all rows, where the second column contains the - character.

Here are the details of the second column...

  1. The second column's header (th) is "Due In"
  2. The values in the second column are strings
  3. There isn't a specific class for the second column

How can I achieve this?

like image 602
TJ. Avatar asked Jun 17 '26 13:06

TJ.


1 Answers

The 2nd in Lucas' answer does not work for me in jquery 1.4, but this does:

$('tr').find('td:eq(1):contains(-)').parent().css('backgroundColor', 'yellow');
like image 188
recursive Avatar answered Jun 19 '26 02:06

recursive