我有这个数据表我想为每一行设置不同的行颜色,我正在使用以下代码,但从未添加过该类
var oTableNE = $('#tabelNE').dataTable({
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
// Bold the grade for all 'A' grade browsers
if ( aData[8] == "Submitted" )
{
$('tr', nRow).addClass("submittedColor");
console.log("Change Color by adding CSS Class" + " nRow " +nRow + " " +aData[0] + " | " +aData[1] + " | " +aData[2]+ " | " +aData[8]);
}else{
console.log("Don't Change Color" + " nRow " +nRow + " " +aData[0] + " | " +aData[1] + " | " +aData[2]+ " | " +aData[8]);
}
}
});