Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions great_tables/_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def tab_options(
container_height: str | None = None,
container_overflow_x: str | None = None,
container_overflow_y: str | None = None,
container_padding_x: str | None = None,
container_padding_y: str | None = None,
table_width: str | None = None,
table_layout: str | None = None,
# table_align: str | None = None,
Expand Down Expand Up @@ -188,6 +190,12 @@ def tab_options(
An option to enable scrolling in the vertical direction when the table content overflows.
Same rules apply as for `container_overflow_x`; the dependency here is that of the table
height (`container_height`).
container_padding_x
The horizontal padding of the table's container. Can be specified as a single-length
character with units of pixels or as a percentage. If provided as a scalar numeric
value, it is assumed that the value is given in units of pixels.
container_padding_y
The vertical padding of the table's container.
table_width
The width of the table. Can be specified as a string with units of pixels or as a
percentage. If provided as a numeric value, it is assumed that the value is given in
Expand Down
4 changes: 4 additions & 0 deletions tests/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def gt_tbl():
container_height="500px",
container_overflow_x="hidden",
container_overflow_y="hidden",
container_padding_x=css_length_val_small,
container_padding_y=css_length_val_small,
table_width=css_length_val_large,
table_layout="auto",
table_margin_left=css_length_val_margin,
Expand Down Expand Up @@ -189,6 +191,8 @@ def test_options_all_available(gt_tbl: GT):
assert gt_tbl._options.container_height.value == "500px"
assert gt_tbl._options.container_overflow_x.value == "hidden"
assert gt_tbl._options.container_overflow_y.value == "hidden"
assert gt_tbl._options.container_padding_x.value == css_length_val_small
assert gt_tbl._options.container_padding_y.value == css_length_val_small
assert gt_tbl._options.table_width.value == css_length_val_large
assert gt_tbl._options.table_layout.value == "auto"
assert gt_tbl._options.table_margin_left.value == css_length_val_margin
Expand Down