Skip to content

Composition

Combine multiple SofraTable instances into a single deliverable.

tbl_merge

tbl_merge(tables: list[SofraTable] | tuple[SofraTable, ...], *, tab_spanners: list[str] | None = None, share_first_column: bool = True) -> SofraTable

Merge tables side-by-side.

Parameters:

Name Type Description Default
tables list[SofraTable] | tuple[SofraTable, ...]

Two or more :class:SofraTable objects with the same number of body rows.

required
tab_spanners list[str] | None

Optional list of spanning-header labels, one per input table.

None
share_first_column bool

When True (default) and every input has the same first column in every row, the duplicate label columns are dropped from the 2nd-Nth tables.

True

tbl_stack

tbl_stack(tables: list[SofraTable] | tuple[SofraTable, ...], *, group_labels: list[str] | None = None) -> SofraTable

Stack tables vertically.

All inputs must share the same column count and header structure. Optional group_labels introduce a group-header row between blocks.