私はデータテーブルプラグインを使用しています。私のテーブルには、その行の列の css を含む列名 css が含まれています。
たとえば、データベース内のテーブルは次のようになります。
Name Priority Percent CSS
---------------------------------------------------------
abc high 50 .priority{color:red} .percent {color:yellow}
xyz low 70 .priority{color:green} .percent {color:green}
pqr medium 10 .priority{color:yellow} .percent {color:red}
データテーブルを表示している間、css 列を含めたくありませんが、特定のセルに css を適用したいと考えています。私は以下のようなものを達成しようとしています、
$('#example').dataTable({
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(row).children().each(function(index, td){
// perform operation here
});
return nRow;
}
同じ行の<td>
css を使用して特定の css を追加する方法がわかりません。<td>
助けてください