from great_tables import pct
pct(80)'80%'
Helper for providing a CSS length value as a percentage.
Usage
A percentage value acts as a length value that is relative to an initial state. For instance an 80% value for something will size the target to 80% the size of its ‘previous’ value. This type of sizing is useful for sizing up or down a length value with an intuitive measure. This helper function can be used for the setting of font sizes (e.g., in style.text()) and for widths (e.g., table_width= in tab_options()). Should a more exact definition of size be required, the analogous helper function px() will be more useful.
x: float str"80%").
The pct() helper turns a number into a CSS percentage.
Here, pct() sets the table’s width to 60% of the width of its container, and the font size of the char column’s values to 80% of the size they’d otherwise have.