Conditionally coloring a cell (not row) based on its value
See original GitHub issueWhat version of React-Table are you using?
6.7.6
What bug are you experiencing, or what feature are you proposing?
I don’t know how to conditionally color a CELL based on it’s value. I’ve read the README, and can conditionally color a row like this:
getTdProps={(state, rowInfo, column, instance) => {
return {
style: {
background: rowInfo.row.severity == "HIGH" ? "green" : null
}
};
}}
Here, if the cell’s value is “HIGH”, the entire ROW is green. What I’d like is for just that cell to be green. How do I do that? A simple example would be nice.
Thanks!
Use https://codesandbox.io/s/X6npLXPRW (by clicking the “Fork” button) to reproduce the issue.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Highlight Rows Based on a Cell Value in Excel (Conditional ...
Want to highlight rows based on a cell value? In this tutorial, I will show you how to use Conditional Formatting to highlight...
Read more >Excel Conditional Formatting Entire Row Based on Cell Value
In Microsoft Excel, with a few easy steps, you can apply conditional formatting that checks the value in one cell, and applies formatting...
Read more >Use conditional formatting to highlight information
Under Select a Rule Type, click Format all cells based on their values (default). Under Edit the Rule Description, in the Format Style...
Read more >Excel: Change the row color based on cell value - Ablebits
Learn how to quickly change the color of the entire row based on a single cell's value in Excel 2016, 2013 and 2010....
Read more >Excel Conditional Formatting Based on Another Cell
This post explores the details of formatting a cell or range based on the value in another cell.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fixed! for future references
https://codesandbox.io/s/744n0nmvl0
Currently not working in V7