background-color only in Column

background-color only in Column

impex09impex09 Posts: 45Questions: 20Answers: 0

Hello, I put a condition in my script that depending on the status of the column, the background-color changes, but I only want the color of the column to change, not all the row, I am doing it in the following way,

if (data.cat_estatus.id_estatus ==2) {
$('td', row).css('background-color', '#f4d03f ');

Can somebody help me?

Thank you.

This question has an accepted answers - jump to answer


  • kthorngrenkthorngren Posts: 19,891Questions: 26Answers: 4,691
    Answer ✓

    Try using:

    $('td:eq(2)', row).css('background-color', '#f4d03f ');

    Where the 2 is the column number.


  • impex09impex09 Posts: 45Questions: 20Answers: 0

    Excellent!!! thanks a lot

Sign In or Register to comment.