great-tables icon indicating copy to clipboard operation
great-tables copied to clipboard

Allow for row height setting

Open deanm0000 opened this issue 1 year ago • 3 comments
trafficstars

Prework

Proposal

It'd be nice if there was a row height setting

Maybe something like

GT(df).tab_style(
    style.height(
        pl.when(pl.col('col1')==5).then(pl.lit('200px')).otherwise(pl.lit('100px'))
        )
    )

deanm0000 avatar Jan 24 '24 06:01 deanm0000

It would also be nice to be able to set the desired column width. Example GT(df).tab_style( style.width([10, 10, 20]) )

or GT(df).tab_style( style.text(col_width=10), loc.body(columns=df.columns[0]) )

Jacobewe avatar Jan 24 '24 13:01 Jacobewe

Ha, yeah, for some reason I thought there was a column width setting, I just haven't needed it.

deanm0000 avatar Jan 24 '24 13:01 deanm0000

There’s now a cols_width() method available. We’ll have a closer look at how to set row heights though.

rich-iannone avatar Feb 01 '24 10:02 rich-iannone