How can I conditionally style a Table Cell, Row, or Column in Slate?

635 views Asked by At

I have a table with a bunch of different values, and I want to style each cell to have a certain color depending on the value. How can I do this in Slate?

1

There are 1 answers

0
vanhooser On

The Slate table widget will render inline HTML and CSS, so the common pattern is to add a Function between your query and the resulting table, map through the values for the column(s) that need styling, and add markup CSS classes that you can then style as needed.

In your Foundry instance, search for Styling Tables to find a robust reference example for common styling patterns and considerations for maintaining sortability with different formatting applied.