I\'m trying to change the styling of some specific cells in a DattaTable, but I\'m not sure how to do that. I know how to change for an entire column, but that\'s not what i
You would use the column configuration's createdCell function.
Basically, you need to add a column definition for the gender column that includes a callback that will be called when the cell is populated. Try adding this object to your columns array:
{
data: "gender",
createdCell: function(td, cellData, rowData, row, col){
var color = (cellData === 'm') ? 'blue' : 'red';
$(td).css('color', color);
}
}
Here is a working example.