Text color property not applying to filter cell (dash_table)

Hi,

When styling filter cells, the property “color” does not apply. Basically, setting style_cell={"color": "red"} or style_filter={"color": "red"} doesn’t change the filter text color. Same for border-color (but border does apply).

Is it a bug?

Thanks!

Hi,

style_cell={"color": "red"} should work, but please note that style_cell has the least priority in style_* props (the full list is here. If you could share a snippet of your DataTable component definition, it might be easier to say why it isn’t working in your case.

border-color won’t work because Dash expects camel cased CSS properties just like React. So borderColor works instead.

Thanks for your reply.

The bug also happens with the code snippet from the documentation [here].
Just add style_cell={"color": "red"} to the DataTable argument. All texts in data cells are colored in red but not for the filter cells.

Oh, I am sorry… I completely ignored what you meant by “filter cell”.

I don’t know if it is a bug or just a design choice. In any case, the cell style does not apply to these cells, as the default style takes precedence. So yeah, it does not work.

I would consider opening an issue in the repository, it might be easier for the maintainers to reply there.

Thanks anyway!

I think it’s a bug since setting style_cell={"background-color": "red"} (or with style_filter) works, which means that this argument affects the filter cells’ style. I opened an issue on GitHub.