How to add color to Checkmark and X within data table?
How to add color to Checkmark and X within data table?
ColdFlow
Posts: 6Questions: 3Answers: 0
I have set up a table that is for an inspection report. When the inspection is done they will either mark 'pass' or 'fail'. In place of the 'pass' or 'fail', I have added a check mark and an 'X'. As the question is stated above, how can I add color to my font? Can it be done through Javascript or do I have to implement it in CSS?
Below is the part of my code where the check mark and X is located:
{ data: "status",
render: function(data,type){
if (type === 'display'){
if(data === 'pass'){
return "✔";
} else if (data === 'fail'){
return "✘";
}
return data;
}
return data;
}
},
Answers
You can return a
span
with the color, similar to the Salary column in this example.Kevin