2026.11.23 · 4 min · css · browsers · html
Your sticky table header is stuck to the wrong box.
Wrap a table in overflow-x: auto and position: sticky on its header silently stops working. The reason is one spec rule that turns overflow-y into auto too. Chrome 156 ships the fix: overflow: auto clip makes the wrapper scroll on one axis only, and sticky is resolved per axis. The cause, the one line, and the gotchas. As of 2026.11.
Every responsive data table ends up inside a <div> with overflow-x: auto, so it scrolls sideways on a phone. That one line also kills position: sticky on the header, with no error and no warning. Developers have asked for a fix since 2017 (CSSWG issue #865, 351 thumbs-up). As of Chrome 156 there is one, and it's one line.
Watch the 60-second version on Instagram.
Why the header scrolls away
The header isn't broken. It's stuck to the wrong box.
Two spec rules meet here. First, the overflow spec: when one axis is scrollable, a specified visible on the other axis computes to auto. So overflow-x: auto alone quietly gives you overflow-y: auto too, and the wrapper becomes a scroll container on both axes.
Second, sticky offsets are measured from "the nearest scroll container with a matching scrollable axis". top: 0 needs a vertical scroller, and the wrapper now counts as one. So the header sticks to the top of the wrapper. But the wrapper never scrolls vertically; the page does. The header rides away with the page, stuck to a box that never moves.
That's why the usual answers miss. "Sticky breaks because of overflow: hidden" and "put sticky on th instead of thead" don't touch the cause, which is visible turning into auto on the other axis.
The fix: a single-axis scroll container
On 2026.03.11 the CSSWG resolved that "position:sticky tracks the nearest scrolling container per axis". Alongside it, the overflow rules changed: a scrollable value (auto, scroll, hidden) can now pair with clip on the other axis. clip stays clip instead of being turned into hidden, and the box becomes a single-axis scroll container.
.table-wrap {
overflow-x: auto;
overflow-y: clip; /* or: overflow: auto clip; */
}
thead th { position: sticky; top: 0; }Now the wrapper scrolls on X only. Sticky is resolved per axis, so each sticky offset finds its own container:
thead { top: 0 }sticks to the page vertically.td:first-child { left: 0 }sticks to the wrapper horizontally.
You get a pinned header and a pinned first column at the same time, which used to need JavaScript.
Where it works
| Status (2026.11) | |
|---|---|
| Chrome | Shipped in 156 (desktop, Android, WebView), stable since 2026.10.20 |
| Edge, Opera | Assumed from Chromium, not checked |
| Firefox | Bug open, unassigned; no signal on standards positions |
| Safari | No signal on standards positions |
Chrome ships per-axis sticky and the overflow change together as one feature ("Single-axis scroll containers"), behind a Finch kill switch (SingleAxisScrollContainers) with a staged rollout. It was testable in the 153 and 154 betas first.
In Firefox and Safari nothing breaks: the table still scrolls sideways, the header just doesn't stick, same as today. That makes it a safe progressive enhancement. To detect it, don't use @supports (overflow: scroll clip), which only checks that the value parses. Use the named feature:
@supports named-feature(single-axis-scroll-container) {
/* per-axis sticky is real here */
}What people get wrong
- "I fixed the wrapper, it still doesn't stick." Any other ancestor with
overflow-x: hidden(oftenbody) traps the header the same way. Useclipthere too. - "Give the wrapper a
max-height." That was the old workaround: scroll both axes inside the box. The header sticks inside the box, and you get a second scrollbar. - "Duplicate the header with JS." The other old workaround (a synced copy, or a separate header table like vh-sticky-table-header). No longer needed in Chrome.
- "
clipis justhidden." Not quite: on the clip axisscrollTo()won't scroll,overscroll-behaviormay stop triggering, and in flex or gridmin-width: autocomes back.
On a client project I'd ship overflow: auto clip today on every table wrapper and delete the JS sticky header only once Firefox and Safari ship it, since until then their users just get the header that scrolls away, which is what they have now.
The short version
overflow-x: autoturnsoverflow-y: visibleintoauto, so the wrapper scrolls on both axes.- Sticky
top: 0sticks to that wrapper, which never scrolls vertically, so the header leaves with the page. overflow: auto clipmakes the wrapper scroll on X only. The header sticks to the page, a first column to the wrapper.- Chrome 156+. Firefox and Safari ignore it safely. Detect it with
@supports named-feature(single-axis-scroll-container). - Check
bodyand other ancestors foroverflow-x: hidden; useclipthere too.
Sources: CSS Overflow 3 · CSS Positioned Layout 3, sticky · CSSWG resolution on #865 · Chrome Platform Status, Single-axis scroll containers · Intent to Ship · Chrome for Developers, Single-axis scroll containers · csswg-drafts #865 · Chrome 156 release notes · Chromium Dash, M156 schedule · Chrome 153 release notes · Mozilla bug 2023702 · freeCodeCamp forum · dev.to, So hard to make table header sticky · vh-sticky-table-header