I am working on data table in which I have to change the color of one td depending on values coming from server.
For now, I have successfully updated the color of complete row, But I am unable to change the color of only one cell in row.
Please see the attached image for current result.
You can see it change the whole color of row BUT I only need to change the color of Second column.
here is my code :
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
if(aData.statusCode == "FAILED"){
$("td", nRow).css("background-color", "Red");
}
if(aData.statusCode == "RUNNING"){
$("td", nRow).css("background-color", "green");
}
}
I am using version DataTables 1.10.15