I had a problem highlighting some rows in a table generated by a vertex.
With dynamic actions and jQuery, I was able to highlight individual columns
JQuery
$('tr td[headers="IDZ"]').each(function(){ if(parseInt($(this).html()) == 12){ $(this).attr('style','background-color:red'); } });
Result in html:
<td align="right" headers="IDZ" style="background-color:red">12</td>
Works fine, the column where IDZ == 12 is now red.
But I want to highlight the entire line, so I thought that let the parent node <tr> and add some "style".
JQuery
$('tr td[headers="IDZ"]').each(function(){ if(parseInt($(this).html()) == 12){ $(this).parent().attr('style','background-color:red'); } });
and the result:
<tr class="even" style="background-color:red">
The line did not change their background color, and I have no idea why. Tested with Firefox and Chrome.
I am grateful for any tips or solutions.
Mario
Mario source share