How to change the class of a cell based on the data
How to change the class of a cell based on the data
CROUSE
Posts: 1Questions: 1Answers: 0
I need to change the font color conditionally based on the data returned. I cannot not find any information on this.
I have created the classes. For the StatusName, I need to change the class if the StatusName == "Active" for example.
Data Table:
function pageReady() {
var table = $('
<
table class="table table-hover table-striped row-border order-column">');
table.prependTo('#MyTable');
var myTable = table.DataTable({
data: myData,
columns: [
...
{ title: "Status", data: "StatusName", class: "centered-text" }
],
deferRender: true
});
This discussion has been closed.