Background color for specific datatable row #2823
-
I've been digging around and haven't found an answer so far, but the docs seem to be expanding quickly, so I'm likely missing things. Glad to see the docs growing and growing! The question: If I'm working with a datatable in row cursor_mode, and the only specifier I have to a row is a RowKey, is it possible for me to change style attributes for just that row, preferably programmatically. Can I use that key somehow as a css selector perhaps? I can't quite figure out how to address the attributes of a row, rather than its contents. Is there a way through datable.rows[RowKey] perhaps? I tried making cells within that row into Rich Text objects, and hoped to set the style on the fly that way, but then sorting isn't supported on Text objects, so that's problematic. Ultimately, I want to be able to set style attributes on whole rows preferably, or cell by cell within a row if necessary. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I asked a similar question about styling DataTable cells a while back: You won't be able to style the cells with CSS as this only works at the widget level - that's not how the DataTable works internally. AFAIK the only way of styling cell values is with Rich renderables such as the Text objects you mention. |
Beta Was this translation helpful? Give feedback.
-
Thanks, Tom. I'll continue with the Text objects then, and fix something up to allow for sorting on a column of them. I wonder if that's a planned feature, given the general support of Rich renderables. |
Beta Was this translation helpful? Give feedback.
I asked a similar question about styling DataTable cells a while back:
You won't be able to style the cells with CSS as this only works at the widget level - that's not how the DataTable works internally.
AFAIK the only way of styling cell values is with Rich renderables such as the Text objects you mention.