How to add color to Checkmark and X within data table?

How to add color to Checkmark and X within data table?

ColdFlowColdFlow 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

  • kthorngrenkthorngren Posts: 20,278Questions: 26Answers: 4,766

    You can return a span with the color, similar to the Salary column in this example.

    Kevin

Sign In or Register to comment.