Table TH
TableTH is a headless component that renders a <th scope="col"> element — a column header cell — intended to live inside a TableRow within TableHead.
Use this component to label the columns of a table.
TableTH is a headless component that renders a <th scope="col"> element — a column header cell — intended to live inside a TableRow within TableHead.
Use this component to label the columns of a table.
<th class="table-th">Column heading</th><Table label="Users">
<TableHead>
<TableRow>
<TableTH>Name</TableTH>
<TableTH>Email</TableTH>
</TableRow>
</TableHead>
<TableBody>
<TableRow>
<TableTD>Alice</TableTD>
<TableTD>alice@example.com</TableTD>
</TableRow>
</TableBody>
</Table>
// In your Svelte component:
import TableTH from "lily-design-system-svelte-headless/components/TableTH/TableTH.svelte";
<TableTH>
<!-- TableTH content -->
</TableTH>
<Table label="Users">
<TableHead>
<TableRow>
<TableTH>Name</TableTH>
<TableTH>Email</TableTH>
</TableRow>
</TableHead>
<TableBody>
<TableRow>
<TableTD>Alice</TableTD>
<TableTD>alice@example.com</TableTD>
</TableRow>
</TableBody>
</Table>
className: string (default: "") -- CSS class appended to the base table-th classcolspan: number (optional) -- number of columns this header cell spansrowspan: number (optional) -- number of rows this header cell spansscope: "col" | "row" | "colgroup" | "rowgroup" (default: "col") -- header scopechildren: optional -- header cell content...restProps: unknown -- additional attributes spread onto the <th> elementNone. Header cells are not interactive.
scope="col" associates the header with its column for assistive technologies. Use scope="colgroup" together with colspan for grouped column headers.
colspan / rowspan<td> elements<colgroup> / <col> -- write those directly inside TableThis headless component renders a <th> element. The consumer provides all visual styling.
The consumer provides all CSS styling. The component renders with a .table-th class for targeting.
<th> elementscope="col" is the defaultcolspan / rowspan are applied when setTableTH is a child of TableRow within TableHead, following the Table pattern: Table > TableHead/TableBody/TableFoot > TableRow > TableTH/TableTD.
table — a table with rows and columns <table>table-body — a table interactive grid tbody <tbody>table-foot — a table interactive grid tfoot <tfoot>table-head — a table interactive grid thead <thead>table-row — a table interactive grid row <tr>table-td — a table interactive grid data cell <td><th> element with scope="col" by defaultclassName for CSS class targetingcolspan / rowspan for grouped header cellsscope (e.g. "colgroup" for grouped headers)restProps onto the <th> elementGenerated from this component's canonical metadata — the machine-checked source the implementations are held to.
scope="col" associates the header with its column for assistive technologiescolspan: number (optional) -- number of columns this header cell spansrowspan: number (optional) -- number of rows this header cell spansscope: "col" | "row" | "colgroup" | "rowgroup" (default: "col") -- header scopechildren: optional -- header cell content...restProps: unknown -- additional attributes spread onto the <th> element