shape: (3, 7)
┌──────┬───────────────────────────┬──────────┬────────────┬─────────┬─────────┬────────┐
│ year ┆ title ┆ run_time ┆ color ┆ size ┆ weight ┆ align │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ i64 ┆ str ┆ str ┆ str ┆ str ┆ str ┆ str │
╞══════╪═══════════════════════════╪══════════╪════════════╪═════════╪═════════╪════════╡
│ 1946 ┆ The Lovers ┆ 1h 30m ┆ papayawhip ┆ small ┆ normal ┆ right │
│ 1946 ┆ Anna and the King of Siam ┆ 2h 8m ┆ lightblue ┆ x-large ┆ bold ┆ center │
│ 1946 ┆ Blood and Fire ┆ 1h 40m ┆ lightgreen ┆ medium ┆ lighter ┆ left │
└──────┴───────────────────────────┴──────────┴────────────┴─────────┴─────────┴────────┘
The color, size, weight, and align columns contain style-related metadata. We can use from_column() to map this metadata to four styling options provided by Great Tables—style.fill(), style.text(), style.borders(), and style.css()—all of which are built on the internal CellStyle class.
One last note:from_column() works with both Pandas and Polars DataFrames. For Polars users, you can also pass expressions directly without wrapping them in from_column(). The following code produces the same styled table as shown above: