Why this wireframe works | Sticky-header table
Which column is which, even halfway down
Scrolling a long table takes the column headers off screen, and “Covered” or “Ask us” no longer says what it answers. The column headers are fixed at the top of the frame, so they stay visible however far down someone reads.
Which row is which, even scrolled sideways
Scrolling sideways takes the first column off screen, and the row being read is lost. The first column is fixed at the left too, so the row and column headers stay whichever way the table moves.
Rows do not show through the fixed headers
A fixed header with no background lets the scrolled rows show through and overlap its text. The headers have a background, and the top-left cell sits in front of everything.
The table scrolls by keyboard too
A table scrolling inside a frame can move by mouse or touch but not always by keyboard. The scrolling frame has tabindex=”0″ and a label, so it can be focused and scrolled by keyboard.
Common mistakes | Sticky-header table
Headers that do not fix inside a sideways-scrolling frame
Put a table in a sideways-scrolling frame and its headers no longer fix against the page scroll; they move away with the frame. Either give the frame a height and scroll inside it, or drop the frame and fix against the page.
Fixed headers hidden under the site header
When the site header stays at the top of the screen and the table header is fixed at the very top, it slides under the site header. When fixing against the page, align the table header with the site header’s height.
Headers with no background, so text overlaps
A fixed header with no background lets the scrolled rows show through. Give the headers a background color.
A frame as tall as the screen, so the page cannot move
On mobile, a frame the height of the screen can mean only the frame scrolls and the page never does. Make the frame shorter than the screen, leaving room to put a finger outside it.
Fixing headers on short tables too
Fixing the headers of a table that fits on one screen achieves almost nothing. Reserve it for long tables whose headers scroll out of view.
FAQ | Sticky-header table
How many rows before fixing the headers?
There is no set number; judge by whether the headers scroll off screen. As a guide, tables of more than 15–20 rows usually read better with the headers fixed.
Scroll inside a frame, or fix against the page?
For a table that is wide as well as long, scrolling inside a frame lets you fix both the column headers and the first column. For a table that fits the width, fixing against the page without a frame avoids double scrolling and is easier to use.
On mobile, fixed headers or cards?
If rows are compared on mobile too, fixed headers suit; if entries are read one at a time, cards suit. Tables that are compared, such as service areas or figures, suit fixed headers.















