Tables
Static HTML tables with sizing, header, contextual, sortable, selectable, sticky-header, toolbar/footer, responsive, and empty/loading variants.
1. Basic table
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
2. Striped & hover
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
3. Bordered & borderless
Bordered
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
Borderless
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
4. Size variants
Small (lp-table--sm)
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
Default
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
Large (lp-table--lg)
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
5. Header variants
Light header (lp-thead--light)
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
Dark header (lp-thead--dark)
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
6. Contextual row colors
| # | Name | Role | |
|---|---|---|---|
| 1 | Primary | primary@example.com | Admin |
| 2 | Secondary | secondary@example.com | Editor |
| 3 | Success | success@example.com | Viewer |
| 4 | Danger | danger@example.com | Editor |
| 5 | Warning | warning@example.com | Admin |
| 6 | Info | info@example.com | Viewer |
| 7 | Active | active@example.com | Admin |
7. Responsive wrapper
A table with many columns overflows its container gracefully. Resize the window.
| # | Name | Phone | Department | Role | Location | Start Date | Manager | Status | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | +1 555 0100 | Engineering | Admin | New York | 2022-03-14 | Jane Doe | Active |
| 2 | Bob Smith | bob@example.com | +1 555 0101 | Product | Editor | San Francisco | 2021-08-02 | John Lee | Active |
| 3 | Carol White | carol@example.com | +1 555 0102 | Design | Viewer | London | 2023-01-19 | Jane Doe | Pending |
| 4 | David Brown | david@example.com | +1 555 0103 | Engineering | Editor | Berlin | 2020-11-05 | John Lee | Inactive |
8. Sortable columns
Click any header to sort. Click again to reverse direction.
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
9. Selectable rows (checkboxes)
Header checkbox toggles all rows. Per-row checkboxes toggle single selections. Listen for the selection-change event.
0 rows selected
| Name | Role | ||
|---|---|---|---|
| Alice Johnson | alice@example.com | Admin | |
| Bob Smith | bob@example.com | Editor | |
| Carol White | carol@example.com | Viewer | |
| David Brown | david@example.com | Editor |
10. Toolbar & footer
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
11. Sticky header
Scroll inside the box — the header row stays pinned.
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
12. Empty & loading states
Empty state
| # | Name | Role | |
|---|---|---|---|
| No records found. Try adjusting your filters. | |||
Loading state (lp-table--loading)
| # | Name | Role | |
|---|---|---|---|
| 1 | Alice Johnson | alice@example.com | Admin |
| 2 | Bob Smith | bob@example.com | Editor |
| 3 | Carol White | carol@example.com | Viewer |
| 4 | David Brown | david@example.com | Editor |
| 5 | Eve Davis | eve@example.com | Admin |
CSS class reference
| Class | Purpose |
|---|---|
.lp-table | Base table |
.lp-table--hover | Highlight rows on hover |
.lp-table--striped | Zebra-stripe rows |
.lp-table--striped-columns | Stripe columns instead of rows |
.lp-table--bordered | Full border grid |
.lp-table--borderless | Remove all borders |
.lp-table--sm / --compact | Reduced padding |
.lp-table--lg | Increased padding |
.lp-table--align-{top|middle|bottom} | Cell vertical alignment |
.lp-table--nowrap | Prevent cell content wrapping |
.lp-table--caption-top | Move caption to the top |
.lp-table--sticky | Pin header row (inside scroll container) |
.lp-table--loading | Dim + stripe overlay |
.lp-thead--light / --dark | Header background variants |
.lp-table-sortable | Sortable column header (toggles --asc/--desc) |
.lp-table-check | Narrow first column for checkboxes |
.lp-table-row--{primary|secondary|success|danger|warning|info} | Contextual row background |
.lp-table-row--selected / --active | Row states |
.lp-table-cell--{success|danger|warning|info} | Contextual cell text color |
.lp-table-responsive | Horizontal scroll wrapper |
.lp-table-toolbar / -title / -actions / -selection-info | Toolbar chrome above the table |
.lp-table-footer | Footer chrome below the table |
.lp-table-empty | Empty-state row cell |
Events
All events are CustomEvents dispatched on the <table> element. They bubble.
| Event | Fires when | event.detail |
|---|---|---|
lp:table:sort |
A sortable header was clicked and rows reordered | { column, direction } |
lp:table:selection-change |
Row selection changed (via checkbox or API) | { selected, all } |
Programmatic API (selectable tables): instance.getSelection(), selectAll(), clearSelection().