themed_gt#

popo.plotting.tables.themed_gt(gt, n_rows=None, width='100%', decimals=None)#

Apply popo’s table style to a Great Tables table or a DataFrame.

Call this last, after headers, spanners and formatting. Passing a pd.DataFrame is a shortcut for themed_gt(GT(df), n_rows=len(df)); a non-default index (bus names, element names) is kept as the first column rather than silently dropped.

Parameters:
  • gt (GT | DataFrame) – Any GT table, or a DataFrame to wrap with GT() first.

  • n_rows (int | None) – Number of body rows, used for the alternating row stripes. Inferred for a DataFrame.

  • width (str) – CSS width of the table.

  • decimals (int | None) – If set and gt is a DataFrame, format every float column to this many decimal places.

Return type:

GT

Returns:

The styled table.