createdCell
createdCell
deliator
Posts: 95Questions: 1Answers: 0
hello,
This worked really fine :
$('#example').dataTable( {
"columnDefs": [ {
"targets": 3,
"createdCell": function (td, cellData, rowData, row, col) {
if ( cellData < 1 ) {
$(td).css('color', 'red')
}
}
} ]
} );
But when i select a row (with red style) blue background with red text are not clearly readable ...
Is there a way to change de text of my red text to white for example ?
Thanks,
Marc
This discussion has been closed.
Replies
Hi Marc,
I'm afraid I don't quite understand. If you want the text white rather than red, just change
'red'
to'white'
. Or is it that you want the colour to change when selected? If so, I would suggest that you add a class to the cell rather than using$().css()
and then in your stylesheet setup suitable rules.Allan