Column
Column is a single header cell, slotted into a
When to use
One column per column, always inside a
Its sort indicator is a presentation hook only, since this element has no
sort behavior of its own. Wire your own click handler and re-render your
rows in the new order to actually sort. See
Install & usage
npm install @eunomia/elements
import "@eunomia/elements/table-column.js";
<eun-table-column width="120px">Status</eun-table-column>
Properties
Column <eun-table-column>
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
| width | string | — | This column's track size, fed verbatim into the table's shared grid template, such as 120px, 20%, or 1fr. A flexible track is used when unset |
| sort | 'ascending' | 'descending' | 'none' | — | Reflects the sort state to assistive technology. Presentation only |
Import the exact TypeScript type behind any property above, see
Slots
| Name | Description |
|---|---|
| (default) | The column header's label content |
CSS custom properties
| Name | Description |
|---|---|
| --table-column-color | Sets the text color |
| --table-column-font-weight | Sets the font weight |
| --table-column-border-color | Sets the color of a vertical divider on this header cell's trailing edge, between it and the next column. Transparent, with no divider, by default |
CSS shadow parts
| Name | Description |
|---|---|
| column | The column's own padded content box. Exposed for effects the column's CSS custom properties don't cover |
Widths
<eun-table-column width="64px">#</eun-table-column>
<eun-table-column width="2fr">Name</eun-table-column>
<eun-table-column width="120px">Status</eun-table-column>
Sort indicator
<eun-table-column width="1fr" sort="ascending">Name</eun-table-column>
role="columnheader". sort reflects aria-sort
("ascending"/"descending"/"none") when set (a presentation hook
only, see the class doc above). It participates in the owning
eun-table's roving-tabindex grid as row 0's cells. See