I am using table & column components from react-virtualised module.
I have a requirement to add color to cell text based on few conditions. I did not find a way to do so.
This is the Link for code reference
Please help me for solution
I am using table & column components from react-virtualised module.
I have a requirement to add color to cell text based on few conditions. I did not find a way to do so.
This is the Link for code reference
Please help me for solution
Found a solution using cell renderer
getColorPalate(risk) {
let riskColor;
switch (true) {
case risk < 25:
riskColor = '#00CD63';
break;
case risk > 25 && risk < 50:
riskColor = '#F8E71C';
break;
case risk > 50 && risk < 75:
riskColor = '#F09502';
break;
default:
riskColor = '#F24343';
break;
}
return ( < div style = {
{
color: riskColor,
}
} > {
risk
} < /div> ); }