How can I conditionally set color to the cells of a table? I would like to set green if the value is less than a certain number, red otherwise (for example).
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] // cellColorArray = ['rgba(255, 255, 255, 1)', 'rgba(100, 100, 100, 1)',...]
}}
}];
Here, cellColorArray is an array containing rgba values for each cell. However, when I run this code, it sets colors for entire rows and not individual cells.