Skip to content

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

Lobby TV
Phoenix · Room 1201 · Online · last seen 10:42
Restaurant screen
Phoenix · Online · last seen 10:41
Spa corridor
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.

NameTypeStatusUpdated
Phoenix Resort ChannelLiveLive26 Oct 10:42
Promo Video (selected row)ScheduledScheduled26 Oct 09:15
Golf HighlightsLiveLive25 Oct 18:30
Nguyen DramasLivePaused25 Oct 12:02
Nguyen SportsLiveLive24 Oct 16:48
Dining Menu LoopScheduledDraft24 Oct 11:20
VietnameseLiveLive23 Oct 08:00
1sticky header (11 px, uppercase, grey)2zebra rows3selected row = light blue, checkbox shown4checkbox hidden until hover5vertical and horizontal 1 px borders

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 marked data-no-drag-scroll.
  • The cursor is grab, and grabbing while 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.

RoleMedia viewMedia editMedia deletePlaylists viewPlaylists editCampaigns viewCampaigns editDevices viewDevices controlSettings
Owner
Editor
Operator
Viewer
1header 44 px high, normal weight, muted2only a bottom border per row, hover tint3buttons and switches are not drag handles

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.

Active 3Scheduled 1Paused 1Drafts 2Completed 4Archived 0
CampaignSourceSchedule & playlistTargets & screensDelivery
Resort welcomeCMP-8F2A1C LiveHouseDaily · All dayPlaylist: Welcome loopLobby group12 screensReach
Breakfast offerCMP-1B77D0 StandbyHouseDaily · Morning 06:00–10:00Playlist: Dining menuRestaurant group4 screensTraffic
Spa campaignCMP-C93E55 ScheduledAdvertiserWeekly · Fri, Sat · EveningPlaylist: Spa promoCorridor group8 screensLeads
1tabs with counts2header 10 px, uppercase, hint colour on a subtle background3"Standby" is a label for a live campaign outside its time window

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.

NameRoleLast active
Mai TranEditorToday 10:12
Somchai K.OperatorYesterday
Linh NguyenViewer22 Oct
1header 12×16 px on the subtle colour2cells 16 px3selected row = C.primarySubtle

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