How to change background color of cells with special value

How to change background color of cells with special value

msrlinliumsrlinliu Posts: 2Questions: 2Answers: 0

Hi,
I got a question about how to change the property of datatables cells which has some special values.
For example, for some cells, their value starts with a "+", in that case, I want to remove the "+" and set the background of those cells to be blue. For the cells whose value starts with a "-". I want to remove "-" and set the background color to be red.
How to write codes to implement that? Thanks

Answers

  • gbutlergbutler Posts: 2Questions: 1Answers: 0

    I'm a noobie, but I think you can use the render option of columnDefs to do that. I've used that to combine values and adjust the CSS.

This discussion has been closed.