Reputation: 1
I'm trying to add conditional formatting to the following;
<tr>
<td><h3>Company</h3></td>
<td><h3>Price</h3></td>
<td><h3>Change</h3></td>
</tr>
<tr>
<td>Example</td>
<td>123.4</td>
<td>-1</td>
</tr>
Where if column "change" is 0 or below the font is red, and green if else.
I found this fiddle, http://jsfiddle.net/davidThomas/Ty497/, which I can adapt, but I can't get it to only work on the third column.
Upvotes: 0
Views: 748
Reputation: 1
I've gone through the provided link.
The solution for your problem is to change the code in two places:
Change the condition in the function for poor is 1
and very poor to 0
.
Change the color for poor in the css part.
Upvotes: 0
Reputation: 437386
Simply change the jQuery selector to $('tbody tr td:nth-child(3)')
so that it only applies to the third cell of each row.
Upvotes: 5