Display
Table
SimpleTable styles plain table markup with a sticky header, hover rows and an optional card layout in narrow containers.
<script>
import { SimpleTable } from "@codeatlasdev/ui";
</script>
<SimpleTable responsive="cards">
<thead>…</thead>
<tbody>…</tbody>
</SimpleTable>
SimpleTable styles plain thead and tbody markup inside a focusable, horizontally scrolling region. For search, sorting and pagination use DataTable. It is exported from @codeatlasdev/ui. @codeatlasdev/ui/table also exports a Table, a bordered wrapper around a plain <table> that forwards native table attributes.
Default (scroll)
A regular table at every width.
| Name | Role | Status | |
|---|---|---|---|
| Ana Souza | ana@example.com | Admin | Active |
| Bruno Lima | bruno@example.com | Editor | Invited |
| Carla Dias | carla@example.com | Viewer | Active |
Code
Cards on narrow containers
When the table's own container is narrower than 600px each row becomes a card. Every cell is captioned with its column header; `data-label` only overrides that. Resize the window to see it.
| Name | Role | Status | |
|---|---|---|---|
| Ana Souza | ana@example.com | Admin | Active |
| Bruno Lima | bruno@example.com | Editor | Invited |
| Carla Dias | carla@example.com | Viewer | Active |
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
responsive | 'scroll' | 'cards' | 'scroll' | `scroll` keeps a regular table. `cards` turns each row into a card when the table's own width is below the `sm` breakpoint (600px). Cell captions come from the `thead` headers automatically. |
class | string | '' | Extra class on the wrapper. |
children | Snippet | undefined | `thead` and `tbody` markup. |