Formato condicional en una tabla

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.

preguntado el 28 de agosto de 12 a las 10:08

2 Respuestas

Simply change the jQuery selector to $('tbody tr td:nth-child(3)') so that it only applies to the third cell of each row.

Respondido 28 ago 12, 10:08

I've gone through the provided link.

The solution for your problem is to change the code in two places:

  1. Change the condition in the function for poor is 1 and very poor to 0.

  2. Change the color for poor in the css part.

Respondido 28 ago 12, 19:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.