GitHub

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.

Team members
NameRoleStatus
Alice SmithAdminActive
Bob JonesEditorActive
Carol WhiteViewerInactive
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'        }),
  ]),
})