Reputation: 145
I am using Jquery datatable. Using Json object i have feed the values in a table. In a table i have value as "FAX" in some cells. My question is i want to highlight entire row with some color which is having "FAX" value in a Table. I have tried below mentioned code but its not working for me
$("#pagination_table tr td:contains('FAX')").css('background','red');
Upvotes: 1
Views: 506
Reputation: 34915
The correct name of the css property is background-color, also the entire row is the parent element.
$("#pagination_table tr td:contains('FAX')").parent().css('background-color','red');
Upvotes: 1
Reputation: 3092
Also that code will only highlight the table cell, you would need
$("#pagination_table tr td:contains('FAX')").closest('tr').css('background-color', 'red');
Upvotes: 4