Menu
All plugins

Responsive Table for Bricks

A nestable Bricks element for tables that read as rows on wide screens and as a stack of cards when the space gets narrow. Because it measures the space it sits in, the same table is a table in the main column and cards in a sidebar.

Version: 0.1.1 · Requires: WordPress 6.0+, PHP 8.1+, Bricks · See the live demo

What it does

  • Rows with aligned columns and a header row on wide screens.
  • Cards below the switch width. The header hides and each cell shows its column label beside its value.
  • Switches by container width (default), a Bricks breakpoint, a custom window width, always, or never.
  • Every cell is a normal Bricks block, so it can hold text, buttons, images, badges or dynamic data. A row can sit inside a query loop.

Installation

  1. Upload and activate the plugin. Bricks must be active.
  2. In the Bricks editor search for Responsive Table (Layout group). It arrives with a header row and three sample rows.

Quick start

  1. Edit the header row’s cells to name your columns.
  2. Edit the cells in each row. To add a row, duplicate one, or use the plus button on the element in the structure panel.
  3. To add a column, duplicate a cell in the header row and in every other row, so every row has the same number of cells.
  4. Open Switch to cards and choose when the cards take over.

How it is built

  • The element is a table wrapper holding rows. Each row holds cells. They carry the classes rt-row and rt-cell. The first row also has rt-head.
  • The first cell of a row has the class is-title and the last has is-action. Neither shows a label on the cards. The title is the card heading and the action (usually a button) fills the card’s width.
  • All other cells get their card label from the header cell in the same position. The label is written once, in the header. To override one, add a custom attribute data-label to that cell.
  • Rows and cells carry table roles (table, row, columnheader, cell), so screen readers still announce a table.

Settings

Switch to cards

  • Switch to cards at — Container width (default), any Bricks breakpoint (window width and below), Custom window width, Always cards, or Never
  • Switch at width (px) — for Container width and Custom window width (default: 720)
  • One card per line at (px) — below this width the cards stack in one column (default: 460; 0 turns it off)
  • Table name — read by screen readers

Table

  • Column widths — a CSS grid-template-columns value, such as minmax(0,2fr) 1fr 1fr 8.5rem. Empty means equal columns.
  • Column gap, Row padding, Corner radius
  • Background, Row divider colour, Header background, Header text colour, Row hover background, Alternate row background (zebra stripes)

Cards

  • Cards per line — 1 to 4 (default: 2)
  • Gap between cards, Card padding, Card corner radius, Card background, Card shadow, Alternate card background, Card hover background, Label colour

Typography, colour and spacing of the content inside the cells use the normal Bricks controls on each cell’s element.

Window width or container width?

The Bricks breakpoints and the custom width compare the browser window to a width. That is right when the whole page should change together, but a table in a 300px sidebar would stay a table on a large screen. Container width measures the space the table sits in, so it becomes cards wherever that space is narrow, including sidebars, columns, popups and off-canvas panels. It is done in CSS and has no flash on load.

Using it in a loop, including an ACF repeater

The loop can be a post, term or user query, or a repeater such as an ACF repeater or a Meta Box group. For a repeater, choose it as the loop type on the item block, then use its sub-fields in the dynamic data. The demo includes an example built from an ACF repeater.

Keep one header row, then put the query loop on a single row block. The table grows with the results, and the card labels, stripes and hover colours work the same way.

  1. Add a Responsive Table with the header row only.
  2. Add one row block below it and give it the classes rt-row. Add the same cells as the header has.
  3. On that row block, switch on Query loop and choose what to list (posts, pages, a custom post type, ACF rows).
  4. Fill the cells with dynamic data, such as Responsive Table for Bricks, 10 Oct 2026 or a custom field. Link a button to https://bricks-playground.co.uk/docs/responsive-table/.

Only the header and the repeating row need to be direct children of the table. The demo page shows the documentation pages of this site listed this way.

Tips

  • Set Column widths on tables with a long title column, and give the action column a fixed width such as 8.5rem.
  • Use rt-desktop-only as a class on cells that should disappear in the card layout, such as a long description.
  • Keep the header text short. It becomes the label on each card.
  • Give each table a name for screen readers.

Known limits

  • Every row needs the same number of cells as the header row, in the same order.
  • The card labels are filled in by a small script after the page loads. Without JavaScript the cards still show, but without labels.
  • The table takes the full width of its parent. If the parent is a flex row, give the parent or table a width so it does not collapse.