TanStackT
TanStack3y ago
12 replies
hurt-tomato

Table Cell backgroundColor depending on a number value

Hello, How to set the color of a number (eventually the backgroundColor) in a column depending on his value?
I'm search a lot but there are very poor documentation especially for the old version 7.

{
Header: 'Bank balance',
accessor: 'balance',
getCellProps: (cellInfo) => ({
style: {
backgroundColor: cellInfo.value > 0 ? 'red' : 'green'
}
})
},
Was this page helpful?