Dash Datatable - how to the set background color for individual cell

Like to find out how to set background color of a individual cell in a Dash Datatable? thanks

This isn’t possible right now. However, you can do this with the new Table graph type in plotly.js. There aren’t many docs on this yet, but you can get started with a simple example here: https://plot.ly/~jackp/18023
and all of the attributes are here: https://plot.ly/python/reference/#table. Note that unlike Dash DataTable, this Table isn’t interactive.

1 Like

It should also be possible to colour individual cells of an html.Table and it is possible to set callbacks to respond to row/cell clicks in a table. I’ve got the second part working, my colleague is going to try the first. We’ll post example code here when done.

This really would be a great feature. Here are some Shiny examples that would be neat to have within Dash: https://rstudio.github.io/DT/010-style.html

Do you have any suggestions with the current codebase to visually indicate magnitude beyond the number itself?

Could you please post the source code for callbacks that respond to cell clicks in a table?
Thanks!

It’s been years. Any closure on this?

yes. look at the documentation at dash.plot.ly/datatable

callbacks yes, color to individual cells, no…

https://dash.plot.ly/datatable/style

ICYMI, the [Conditional Formatting | Dash for Python Documentation | Plotly](conditional formatting chapter) has been updated substantially to include more examples. Announcement in 📣 DataTable Conditional Formatting Documentation.