Table layout¶
Tellyboard has four ways of drawing a table. They exist because pages were built at different times; this page says what each one is, how it is laid out, and which pages use it.
| # | Style | Defined in | Used by |
|---|---|---|---|
| 1 | .pt-table: plain HTML table with the shared CSS |
table.css from @playtelly/tellyboard-theme |
Channels / Feeds, Playlists |
| 2 | ui/table.jsx: shadcn-style Table with grab-to-scroll |
src/components/ui/table.jsx |
device group tabs (target, policy, playback, operation groups), device group detail, roles and permissions |
| 3 | Inline-styled table with C colours |
in the page | Campaigns |
| 4 | tableTheme: style objects for hand-written tables |
@playtelly/tellyboard-theme (tableTheme) |
available to any page (wrap, table, th, td, row(isSelected), checkbox) |
Screens (DisplaysTable.jsx) are not a table: each display is a card (DisplayCard) in a list.
Screens page: each display is a card (DisplayCard) in a list, not a table
Phoenix · Room 1201 · Online · last seen 10:42
Phoenix · Online · last seen 10:41
Offline · last seen yesterday 22:10
Examples on this page are live
The grey boxes below are drawn with the same CSS as the real pages (light theme). Scroll the wide table by dragging it with the mouse, and hover a row of the first table.
1. .pt-table (the standard list table)¶
<div class="pt-table-wrap">
<table class="pt-table" data-density="comfortable">
<thead><tr><th><span class="pt-th-inner">Name</span></th> ... </tr></thead>
<tbody><tr class="selected"><td>...</td></tr></tbody>
</table>
</div>
1. .pt-table inside .pt-table-wrap: the header stays while the body scrolls (the real wrapper is as tall as the window minus 340 px). Hover a row to see its checkbox.
| Name | Type | Status | Updated | |
|---|---|---|---|---|
| Phoenix Resort Channel | Live | Live | 26 Oct 10:42 | |
| Promo Video (selected row) | Scheduled | Scheduled | 26 Oct 09:15 | |
| Golf Highlights | Live | Live | 25 Oct 18:30 | |
| Nguyen Dramas | Live | Paused | 25 Oct 12:02 | |
| Nguyen Sports | Live | Live | 24 Oct 16:48 | |
| Dining Menu Loop | Scheduled | Draft | 24 Oct 11:20 | |
| Vietnamese | Live | Live | 23 Oct 08:00 |
Layout rules (from table.css)
| Part | Rule |
|---|---|
Wrapper .pt-table-wrap |
1 px border #e5e7eb, white background, scrolls both ways, max-height: calc(100vh - 340px), small shadow, square corners |
| Table | full width, border-collapse: collapse, table-layout: auto |
Header th |
8 px × 12 px padding, background #f9fafb, sticky (top: 0), 11 px, bold, uppercase, letter-spacing 0.05em, colour #6b7280, right border between columns |
Cell td |
8 px × 12 px padding, vertically centred, bottom and right borders |
| Rows | zebra (even #f9fafb, odd white), hover #f9fafb, selected #eff6ff (tr.selected) |
Checkbox .pt-checkbox |
16 px, hidden until the row is hovered or selected |
Header content .pt-th-inner |
inline flex with a 6 px gap (label plus sort icon) |
The page sets data-density from the Table density preference (Preferences page, key ui_prefs, default comfortable). The Channels table does this today.
Sorting, filtering and pagination come from TanStack Table (@tanstack/react-table) in Channels, Playlists and the transcoding profile list.
Colours are hard-coded here
table.css uses literal greys, so these tables do not follow dark mode. See Color theme.
2. ui/table.jsx (drag to scroll)¶
A shadcn-style Table with a wrapper that gives mouse grab-to-scroll horizontally:
- Only for the mouse (
pointerType === "mouse", left button). Trackpads and touch keep native scrolling. - It ignores presses on
button, a, input, select, textarea, [role=checkbox], [role=switch]and on anything markeddata-no-drag-scroll. - The cursor is
grab, andgrabbingwhile dragging; text selection is off while dragging. - The wrapper is
relative w-full overflow-auto overscroll-x-contain.
Use it for wide tables with many columns (permission matrices, group tabs).
2. ui/table.jsx: a wide permission matrix. Drag it sideways with the mouse (grab cursor); trackpad and touch scroll normally.
| Role | Media view | Media edit | Media delete | Playlists view | Playlists edit | Campaigns view | Campaigns edit | Devices view | Devices control | Settings |
|---|---|---|---|---|---|---|---|---|---|---|
| Owner | ||||||||||
| Editor | ||||||||||
| Operator | ||||||||||
| Viewer |
3. Campaign table¶
The campaigns page draws its own <table> with the C colours: header cells 10 px bold uppercase in C.textHint on C.subtle, columns Campaign, Source,
Schedule & playlist, Targets & screens, Delivery, status tabs above the table. See Campaigns.
3. Campaign table: inline styles with the C colours, status tabs on top, a lifecycle dot and a status chip per row.
| Campaign | Source | Schedule & playlist | Targets & screens | Delivery |
|---|---|---|---|---|
| Resort welcomeCMP-8F2A1C Live | House | Daily · All dayPlaylist: Welcome loop | Lobby group12 screens | Reach |
| Breakfast offerCMP-1B77D0 Standby | House | Daily · Morning 06:00–10:00Playlist: Dining menu | Restaurant group4 screens | Traffic |
| Spa campaignCMP-C93E55 Scheduled | Advertiser | Weekly · Fri, Sat · EveningPlaylist: Spa promo | Corridor group8 screens | Leads |
4. tableTheme (style objects)¶
tableTheme in tellyboard-theme is a set of style objects for hand-written tables: wrap, table, th, thInner, td, row(isSelected), checkbox.
Because they use the C colours, they follow the colour theme. Compared with .pt-table: bigger padding (12 px × 16 px headers, 16 px cells), rounded 8 px wrapper, a selected row in C.primarySubtle.
import { tableTheme as t } from "@playtelly/tellyboard-theme"
<div style={t.wrap}>
<table style={t.table}>
<thead><tr><th style={t.th}>Name</th><th style={t.th}>Role</th></tr></thead>
<tbody>
<tr style={t.row(selected)}><td style={t.td}>Mai</td><td style={t.td}>Editor</td></tr>
</tbody>
</table>
</div>
4. tableTheme: roomy cells, rounded wrapper, the selected row uses the primary subtle colour.
| Name | Role | Last active | |
|---|---|---|---|
| Mai Tran | Editor | Today 10:12 | |
| Somchai K. | Operator | Yesterday | |
| Linh Nguyen | Viewer | 22 Oct |
Choosing one for a new page¶
| Need | Use |
|---|---|
| A standard list with sorting, selection and density | .pt-table with TanStack Table |
| A wide matrix | ui/table.jsx |
| Something that must follow the colour theme and dark mode | tableTheme or ui/table.jsx (they read tokens), not .pt-table |