Is there a way to conditionally assign colors to individual cells in a table? I want to display them as green if the cell value is below a certain number, and red otherwise.
var data = [{
type: 'table',
header: {
values: fore_draft_lst_show,
align: "center",
line: {
width: 1,
color: 'black'
},
fill: {
color: "grey"
},
font: {
family: "Arial",
size: 12,
color: "white"
}
},
cells: {
values: values,
align: "center",
line: {
color: "black",
width: 1
},
font: {
family: "Arial",
size: 11,
color: ["black"]
},
fill: {
color: [
'rgba(140,124,66,1)',
cellColorArray
] // where cellColorArray = ['rgba(255, 255, 255, 1)', 'rgba(100, 100, 100, 1)',...]
}
}
}];
I have encountered an issue where the code sets colors for entire rows instead of individual cells from the array provided. Any suggestions on how to resolve this?