Formato condicional en una tabla
Frecuentes
Visto 728 veces
0
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.
2 Respuestas
5
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
0
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 to0
.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 jquery html css formatting or haz tu propia pregunta.