How to Make a Responsive Table WordPress?
Make a WordPress table scroll or stack on phones: the Fixed width cells setting, a min-width rule, stacked cards, alignment traps and accessibility, tested.

To make a responsive table in WordPress, insert a core Table block, open its settings and switch off Fixed width table cells, so the table can grow wider than the screen and scroll sideways inside its own box. For tables with many columns, add a small CSS rule that gives the table a minimum width on phones, and do not centre-align it. If each row is a self-contained record, such as a pricing plan, you can instead turn rows into stacked cards on small screens with CSS and a short PHP filter.
That is the short answer. The long one matters, because the default changed in mid-2024 and a lot of older advice now gives the wrong result. Our team checked every claim below on 18 November 2026 against the Table block source in the Gutenberg repository and WordPress 7.1.4, and measured each layout in Chromium at a 390 pixel wide phone viewport.
Does the WordPress Table block make tables responsive on its own?
Partly. The core Table block saves a <figure class="wp-block-table"> with a normal <table> inside. The block’s front-end stylesheet gives that figure overflow-x: auto, so if the table ever becomes wider than its container, a horizontal scrollbar appears on the figure instead of the whole page sliding sideways. You can read the rule yourself in the block’s style.scss.
The catch is the word “ever”. A table only gets wider than its container if its content forces it to. With the default settings, it usually does not, so the scrollbar never shows up and the columns squeeze instead.
Here is what we measured with a seven-column pricing table on a 390 pixel screen, using the core Table block’s own CSS:
Setup | Table width | What the reader sees |
|---|---|---|
Default (fixed width cells on) | 358px, fits the screen | Seven 51px columns; the first row is 137px tall because words wrap letter by letter |
Fixed width cells off | 561px | The figure scrolls sideways; the first row drops to 89px tall |
Fixed width cells off, aligned centre | 543px | The figure stops scrolling and the whole page becomes 559px wide |
Fixed width on, plus a min-width rule | 640px | The figure scrolls; rows are 65px tall and easy to read |
Stacked cards (CSS + labels) | 358px | One card per row, label and value side by side |
Two of those rows surprise most people. The default is the squeezed one, and centring a table breaks the page on phones. Both come straight from core CSS, as the next two sections show.
What does the Fixed width table cells setting do?
It switches the table between two CSS layout modes. When it is on, the block adds the class has-fixed-layout to the <table>, and core CSS applies table-layout: fixed with width: 100%. The browser then splits the available width between the columns and ignores how long the content is. To stop text spilling out of those narrow columns, core also sets overflow-wrap: anywhere on the cells, which allows a line break between any two letters.
When it is off, the table uses the browser’s automatic layout. Columns size themselves to their content, long words stay whole, and if the content needs more room than the screen has, the table grows wider and the figure scrolls.
The setting lives in the block sidebar under Settings, labelled Fixed width table cells, next to the Header section and Footer section toggles. In the block’s block.json it is the hasFixedLayout attribute, and its default is true.
That default is new-ish. Gutenberg pull request #49672, merged in March 2024 for Gutenberg 18.0, switched fixed width cells on for every newly inserted table, and the change reached WordPress core in version 6.6 that July. We confirmed it in core’s own copy of the block: the default is false in WordPress 6.5 and true from 6.6 onward. Tables created before that keep the setting they were saved with. So a site can easily have old tables that scroll and new ones that squeeze, which explains a lot of “my tables suddenly look different” reports.
When should fixed width stay on?
Fixed width is the right call for narrow tables with short values: two or three columns of numbers, a spec sheet, a simple yes and no matrix. The columns stay even, the table never pushes the layout around, and nothing scrolls. Switch it off when you have five or more columns, long words such as product names or URLs, or code in the cells.
How do I make a WordPress table scroll sideways on mobile?
There are two ways, depending on how much control you want.
The no-code way: turn fixed width off
- Select the table in the editor.
- In the block sidebar, open Settings and switch off Fixed width table cells.
- Leave the alignment at none, wide or full. Do not pick left, centre or right.
- Update the post and check it on a phone, or in your browser’s device mode at 390 pixels wide.
This works well when the content itself is wide. With short values, the automatic layout may still fit everything on screen and squeeze it, because the browser tries hard to avoid overflow. That is where the CSS method comes in.
The reliable way: a minimum width on small screens
Give the table a class, then tell the browser it may not shrink below a sensible width on phones. In the block sidebar, open Advanced and type is-scroll-table into Additional CSS class(es). The class lands on the figure, which is the element that scrolls. Then add this CSS:
/* Checked on 18 November 2026 against the core Table block CSS in WordPress 7.1.4 */
@media (max-width: 600px) {
.wp-block-table.is-scroll-table table {
min-width: 40rem;
}
}On a block theme, paste it under Appearance > Editor > Styles, then the Additional CSS option in the Styles panel menu. On a classic theme, use Appearance > Customize > Additional CSS, or your child theme’s stylesheet. In our test the table became 640 pixels wide on a 390 pixel screen, the figure scrolled, and the page itself stayed at 390. Pick the min-width that suits your column count; roughly 6rem per column is a fair start.
Want every table on the site to behave this way? Drop .is-scroll-table from the selector. We prefer the opt-in class, because a three-column table does not need to scroll at all.
Make the scroll obvious
Phones hide scrollbars until you touch the content, so readers may not know there is more to the right. Gutenberg issue #8401 raised exactly this back in 2018. Three small fixes help: put the most important column first, keep a short caption or sentence above the table that says it scrolls, and do not let the first column be a decorative one. A light shadow on the right edge is a common visual cue, but test it in dark mode before you ship it.
Why does a centred table break the layout on phones?
Because core CSS changes how aligned tables are displayed. When you choose left, centre or right alignment, the block adds an alignleft, aligncenter or alignright class to the figure, and the stylesheet sets that figure to display: table with width: auto, so the table can shrink to its content and sit in the middle. A box that displays as a table does not clip its overflow the way a normal block does, so the scroll container disappears.
In our test the centred table grew to 543 pixels and dragged the whole page out to 559 pixels on a 390 pixel phone. Readers then see a page that wobbles sideways under their thumb. If you want a narrow table centred on desktop, keep the alignment at none and centre it with CSS on wider screens only.
How do I turn a table into stacked cards on small screens?
Stacked cards suit tables where every row is a complete record: a pricing plan, a team member, an event. On a phone each row becomes a small card, with the column name on the left and the value on the right. This needs two pieces, because the block editor has no way to add the column name to each cell.
Step 1: copy the column names onto each cell
This filter runs only on Table blocks that carry the is-stack-table class. It reads the labels from the header row and writes them into a data-label attribute on every body cell, using the WP_HTML_Tag_Processor class that has been in core since WordPress 6.2. Put it in a small plugin or your child theme’s functions.php.
<?php
/**
* Add data-label attributes to Table blocks that use the is-stack-table class.
* Checked on 18 November 2026 with WordPress 7.1.4 and PHP 8.5.
*/
add_filter(
'render_block_core/table',
function ( $block_content, $block ) {
$class = $block['attrs']['className'] ?? '';
if ( ! str_contains( $class, 'is-stack-table' ) ) {
return $block_content;
}
// Read the column labels from the header row.
if ( ! preg_match( '#<thead[^>]*>(.*?)</thead>#s', $block_content, $thead ) ) {
return $block_content;
}
preg_match_all( '#<th[^>]*>(.*?)</th>#s', $thead[1], $cells );
$labels = array_map( 'wp_strip_all_tags', $cells[1] );
// Copy each label onto the matching body cell.
$tags = new WP_HTML_Tag_Processor( $block_content );
$in_body = false;
$column = 0;
while ( $tags->next_tag( array( 'tag_closers' => 'visit' ) ) ) {
$name = $tags->get_tag();
if ( 'TBODY' === $name ) {
$in_body = ! $tags->is_tag_closer();
continue;
}
if ( ! $in_body || $tags->is_tag_closer() ) {
continue;
}
if ( 'TR' === $name ) {
$column = 0;
} elseif ( 'TD' === $name || 'TH' === $name ) {
if ( 'TD' === $name && isset( $labels[ $column ] ) ) {
$tags->set_attribute( 'data-label', $labels[ $column ] );
}
++$column;
}
}
return $tags->get_updated_html();
},
10,
2
);We ran this filter against the WordPress 7.1.4 HTML API on sample block markup. Body cells got the right labels, a row header cell kept its scope and got no label, the footer was left alone, and tables without the class came back byte for byte unchanged. Two limits to know: it needs the Header section toggle on, and it does not try to handle merged cells with colspan.
Step 2: restyle the rows on phones
/* Checked on 18 November 2026 at a 390px viewport */
@media (max-width: 600px) {
/* Hide the header row visually but keep it for screen readers. */
.wp-block-table.is-stack-table thead {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.wp-block-table.is-stack-table tr {
display: block;
margin-bottom: 1rem;
border: 1px solid currentColor;
}
.wp-block-table.is-stack-table tbody th {
display: block;
}
.wp-block-table.is-stack-table td {
display: flex;
gap: 1rem;
justify-content: space-between;
border: 0;
border-bottom: 1px solid currentColor;
}
.wp-block-table.is-stack-table td::before {
content: attr(data-label);
font-weight: 700;
}
}Add is-stack-table under Advanced > Additional CSS class(es) on the table you want stacked. In our test each body cell became a full-width 356 pixel line inside its card, and nothing overflowed. If your site is right-to-left, the flex layout flips on its own, so the label stays on the reading side.
The accessibility trade-off with stacked cards
Changing display on table rows and cells can make some browser and screen reader pairs stop treating the content as a table, so users lose the ability to move by row and column. Accessibility consultant Adrian Roselli has documented this for years, and his Under-Engineered Responsive Tables post, updated in October 2026, still recommends a plain scrolling wrapper for real data tables. Our rule of thumb: stack records, scroll data. If people compare values across rows, keep the grid and let it scroll.
Should I use a table plugin like TablePress instead?
Use a plugin when the table is data you manage, not just content you write. The core block is fine for a ten-row comparison inside a post. It is a poor fit for a 500-row price list that changes weekly, a table you import from a spreadsheet, or one table shown on several pages.
TablePress is the plugin most people reach for. On 18 November 2026 the WordPress.org plugin API listed version 3.4.1, last updated 12 October 2026, more than 600,000 active installs, a 100 percent rating from 4,625 reviews, and testing up to WordPress 7.1.4. You build tables in its own editor and place them with a block or a shortcode; if shortcodes are new to you, our explainer on whether plugins have shortcodes in WordPress covers how they work.
Be clear on what is free. The free plugin includes a Horizontal Scrolling option, which we confirmed in the 3.4.1 source, and it relies on the DataTables JavaScript library being switched on for that table. The dedicated Responsive Tables module with its Scroll, Collapse, Modal, Stack and Flip modes is part of the paid TablePress Pro and Max plans.
Option | Best for | Cost and weight |
|---|---|---|
Core Table block + CSS | Tables written inside one post | Free, no extra scripts |
Core block + stack filter | Short record lists, pricing rows | Free, a few lines of PHP and CSS |
TablePress free | Large or shared tables, sorting, search | Free, loads DataTables JS when enabled |
TablePress Pro or Max | Stack, collapse or flip modes per table | Paid licence, same JS |
JavaScript table features have a cost on mobile. If you switch on sorting and search for every table, check how the extra scripts affect loading; our guide to removing render-blocking CSS and JS shows how to measure that.
How do I make a WordPress table accessible?
A responsive table that a screen reader cannot follow is only half done. The W3C’s Tables Tutorial lists what assistive technology needs, and most of it maps onto settings you already have.
- Turn on the header section. The Header section toggle adds a header row inside a
<thead>with<th>cells. Type your column names there, not in a bolded first body row, so a screen reader can announce the column name with each value. - Know where the caption goes. The block’s caption is saved as a
<figcaption>on the figure, not a<caption>inside the table. It describes the figure visually, but screen readers do not always announce it as the table’s name. If the table needs a name, put a clear heading right above it as well. - Row headers need pasting. The editor has no button for a header cell in the first column, or for
scope. The block’s paste rules do keep<th scope="row">,colspanandrowspanwhen you paste an HTML table, which you can see in its transforms.js. So build complex tables in HTML or a spreadsheet and paste them in. - Avoid merged and multi-level headers. There is no merge-cells tool yet (Gutenberg issue #15821, open since 2019), and multi-level headers are tracked as an accessibility gap in #56546. Two simple tables beat one clever one.
- Keep the scroll box reachable by keyboard. Recent Chrome and Firefox versions let keyboard users focus a scroll container that has no focusable children, as Chrome’s post on keyboard focusable scrollers explains. For other browsers, a theme can add
tabindex="0"to the wrapper, which is the pattern Roselli recommends. - Use real colour contrast. The Stripes style and the cell background colours look nice, but check text contrast on each stripe, and again in dark mode if your theme has one.
Tables also sit inside layout blocks more often than people think. If yours lives in a Columns or Group block with its own padding, the scroll box shrinks with it; our post on the Group block in Gutenberg explains how those wrappers size their children.
How do I test a responsive table before publishing?
Do not trust the editor canvas. It is not the same width as your theme’s content column, and editor styles differ from front-end styles. Test the published page, or the preview, in a real browser.
- Open the page in Chrome, press F12, and switch on device mode. Set the width to 390 pixels, then 360 for older Android phones.
- Scroll the page itself sideways. If it moves, something is wider than the screen, and the table is the usual suspect.
- Paste this into the console to find the offender:
// Checked on 18 November 2026 in Chrome. Lists elements wider than the viewport.
[...document.querySelectorAll('body *')]
.filter((el) => el.getBoundingClientRect().right > innerWidth + 1)
.map((el) => el.tagName.toLowerCase() + '.' + [...el.classList].join('.'));- Swipe the table on a real phone. Make sure the first column still makes sense on its own.
- Tab through the page with a keyboard and confirm you can reach and scroll the table.
- Switch the theme to dark mode if it has one, and check borders and stripes.
An inner element showing up in that list is fine as long as its scroll container is not in the list too. If the figure, a Group block or main appears, the overflow is escaping to the page.
Common mistakes people report
These problems come up again and again in support forums and the Gutenberg tracker. Each one links to the original report, with its date. Checked on 18 November 2026.
- Tables that used to scroll stopped scrolling. A GeneratePress user said wide standard tables suddenly lost their horizontal scroll site-wide and spilled into the sidebar (GeneratePress forum, July 2022). Check whether the alignment or the fixed width setting changed, since either one removes the scroll.
- Default CSS that squeezes instead of scrolling. A developer filed Gutenberg issue #70454 in June 2025 because the default styles let a table shrink until the text was unreadable before any scrollbar appeared. A later report, #76800 from March 2026, was closed as a duplicate of it, so there is still no built-in mobile mode.
- Expecting the theme to fix it. A site owner asked why the default table overflowed on mobile with one theme but not another, and was told tables are not responsive by default and to try a plugin (GeneratePress forum, September 2020). The real difference is the theme’s own table CSS, which is why the min-width rule above is theme-independent.
- Using a scroll value that is always on. A common forum fix sets
overflow-x: scrolland a 600pxmin-width(GeneratePress forum, June 2021). It works, butscrollshows a scrollbar track on some desktops even when nothing overflows. Core already usesauto, so you only need the width rule. - Assuming the free plugin stacks rows. Forum answers often say “use TablePress for responsive tables” and add that the premium version has the responsive feature (GeneratePress forum, May 2018). That is still true in 2026: the free plugin scrolls, the stack and collapse modes are paid.
Frequently asked questions
Why does my WordPress table look squashed on mobile?
Most likely Fixed width table cells is on, which has been the default for new tables since WordPress 6.6. It forces all columns into the screen width and breaks words between letters. Switch it off, or add the min-width rule, and the table will scroll instead.
Can I make a table responsive without a plugin?
Yes. The core Table block already wraps the table in a scrolling figure. Turning fixed width off, leaving alignment at none, and adding one CSS rule covers most tables. Stacked cards need a short PHP filter and some CSS, still no plugin.
Does a wide table hurt SEO?
A table that scrolls inside its own box is fine. A table that makes the whole page wider than the phone screen causes horizontal page scrolling, which is a poor mobile experience and something to fix. Keep the overflow inside the figure.
Is the table still readable by Google if it scrolls?
Yes. Scrolling is purely visual. The full table is in the HTML, so search engines and AI tools read every row and column whether or not a visitor scrolls.
Should I use an image of a table instead?
No. An image cannot be read by screen readers, cannot be searched or copied, and shrinks into an unreadable picture on phones. Keep tables as real HTML.
How many columns are too many for mobile?
There is no fixed number, but past four or five columns most phones need a scroll or a different layout. If readers mainly compare two columns, consider splitting the table, or moving rarely used columns into a second table.
A quick checklist
- Header section on, so the first row is real header cells.
- Fixed width table cells off for wide tables, on for short narrow ones.
- Alignment none, wide or full; never left, centre or right on a wide table.
- Add
is-scroll-tableplus the min-width rule for tables with many columns. - Use
is-stack-tablewith the filter only for record-style rows. - Test at 390 pixels, scroll the page sideways, and tab to the table with a keyboard.
Tables are not the only element that can push a mobile layout wider than the screen. Embedded videos do it too, and our guide to embedding a YouTube video in WordPress covers keeping them inside the column.
Plugins we build and run
We maintain these ourselves, which is why we can support them on your site.
- BuddyNextThe self-hosted community engine for WordPress
- BuddyXFree community theme, Pro when you outgrow it
- ReignPremium community theme. Add pieces, build anything
- JetonomyCommunity forum and Q&A for WordPress
- EventonomyEvents and RSVPs for WordPress communities
- LearnomyCourses and learning communities on WordPress
- ListoraDirectories and listings your members can browse
- SnipShareCode sharing built for developer communities
- WB Ad ManagerAd placements that turn traffic into revenue
- WP Career BoardA job board your community actually uses
- WP Sell ServicesSell services with offers, orders, and payouts
- MediaVersePhotos, video, and media albums for members
- WB GamificationPoints, badges, and rewards that keep members active
- Product RoadmapPublic roadmaps with voting your users trust
Related Posts

LiteSpeed Cache Vulnerability CVE-2026-93389: Check Your Version and What Was Exposed

Freemius SDK Stored XSS: How to Find Every Bundled Copy on a Client Site (Anything Under 2.13.5)
