Column group
Introduction
Section titled “Introduction”ColumnGroup draws one header above a set of child columns. Use it when related fields should share a label — shipping address pieces, payment totals, customer contact details — so the table reads as labeled sections instead of a flat list of headers.
Pass the group label and the child columns to ColumnGroup.make(...):
from almasix.orbit.tables import ColumnGroup, TextColumn
ColumnGroup.make("Customer", [ TextColumn.make("customer_name").searchable(), TextColumn.make("email").copyable(),])An alternate constructor accepts the columns first when you’d rather set the label afterwards:
ColumnGroup.make([ TextColumn.make("city"), TextColumn.make("country"),]).label("Location")Child columns keep every helper they’d normally have — sorting, searching, money, badges, and editable inputs all still work exactly as if the column weren’t grouped. The group only adds a second header row above them.
Customizing the group header alignment
Section titled “Customizing the group header alignment”The group’s header can be aligned independently of its children:
ColumnGroup.make("Totals", [...]).align_end()Wrapping the group header
Section titled “Wrapping the group header”If the group’s label is long, allow it to wrap instead of clipping:
ColumnGroup.make("Shipping details", [...]).wrap_header()Full example
Section titled “Full example”from almasix.orbit.tables import Table, TextColumn, ColumnGroup
Table.make("orders").columns([ TextColumn.make("number").label("#").sortable(), ColumnGroup.make("Customer", [ TextColumn.make("customer_name").searchable(), TextColumn.make("email").copyable(), ]), ColumnGroup.make("Totals", [ TextColumn.make("amount").money("USD").align_end().sortable(), TextColumn.make("status").badge().color("success"), ]).align_end(),]).records([ { "id": 1, "number": "#1042", "customer_name": "Ada Lovelace", "email": "ada@example.com", "amount": 4899, "status": "paid", }, { "id": 2, "number": "#1043", "customer_name": "Grace Hopper", "email": "grace@example.com", "amount": 1200, "status": "due", },])Key methods
Section titled “Key methods”| Method | Effect |
|---|---|
ColumnGroup.make(label, [columns]) |
Labeled constructor |
ColumnGroup.make([columns]).label(...) |
Alternate shape |
.columns([...]) / .get_columns() |
Set / inspect children |
.align_start() / .align_center() / .align_end() |
Group header alignment |
.wrap_header() |
Allow the group label to wrap |
| Children | Any Column — including money, badges, and editable columns |
Preview
Section titled “Preview”
