table
The scroll wrapper has role="region" and tabindex="0" so keyboard users can scroll horizontally on narrow screens. Row cells are raw HTML slots — wrap user-supplied values in escHtml() when building them.
| Name | Role | Status |
|---|---|---|
| Alice Smith | Admin | Active |
| Bob Jones | Editor | Active |
| Carol White | Viewer | Inactive |
table({
caption: 'Team members',
headers: ['Name', 'Role', 'Status'],
rows: server.users.map(u => [
escHtml(u.name),
badge({ label: u.role, variant: u.role === 'admin' ? 'info' : 'default' }),
badge({ label: u.status, variant: u.active ? 'success' : 'default' }),
]),
})