## table (`poetry_table`)

A semantic table for rows and columns of data.

Class: Poetry::Ui::Table::Component - BEM block `poetry-ui-table`.
Content block REQUIRED (the table sections (poetry_table_* helpers)) - a blockless call raises.
- `container_class:` (string) - Extra classes for the scroll container - e.g. "max-h-96" to cap its height.
- `scroll_label:` (string) - The scroll region's accessible name, required with sticky_header: a scrollable region a keyboard can't reach fails WCAG (axe scrollable-region-focusable), and a focusable region needs a name.
- `sticky_header:` (boolean) - default false - Pins the <thead> while the container scrolls; needs a height cap (container_class:) to take effect, and requires scroll_label:.
- PART `table` - The semantic <table> element itself - the root the part helpers compose into
- PART `table-caption` - The <caption> (poetry_table_caption) - the table's accessible purpose
- PART `table-header` - The <thead> (poetry_table_header) holding the column-header row
- PART `table-body` - The <tbody> (poetry_table_body) holding the data rows
- PART `table-footer` - The <tfoot> (poetry_table_footer) - totals/summary rows
- PART `table-row` - A <tr> (poetry_table_row) in any section | states: data-selected (the row is marked selected (presence attribute, no value) - the theme tints it)
- PART `table-head` - A column header <th> (poetry_table_head)
- PART `table-cell` - A data <td> (poetry_table_cell)
In blocks: `data-index` - for a screen, start from the block (MCP compose/describe_block, or `bin/rails g poetry:block`), not from scratch.
- RULE: Compose the table with the part helpers (poetry_table_header/_body/_row/_head/_cell) - they carry the data-slot + classes onto real thead/tbody/tr/th/td.
- RULE: A column header is poetry_table_head (a <th>); a data cell is poetry_table_cell (a <td>).
- RULE: Mark a selected row with data-selected on poetry_table_row - never a bespoke highlight class.
- RULE: sticky_header: true pins the thead while the container scrolls - it only scrolls once container_class: caps the height ("max-h-96"); without a cap nothing sticks.
- RULE: sticky_header requires scroll_label: - the container becomes a focusable scroll region (tabindex=0 + role=region) and a keyboard-reachable region needs a name (the ScrollArea rule).
