Skip to main content

BETANow in public beta.Public betaBeta

日本語Español

TBL-009 Published

Sticky-header table

A table design for tables with many rows: the column headers stay at the top of the view while scrolling, and when the table is wide the first column stays at the left too.

FigmaThis part is included in our free, editable Figma file: 235 website UI patterns across 32 parts, 2 designs each Open in Figma Community ↗ (opens in a new tab)

Wireframe (desktop) | Sticky-header table

Sticky-header table UI design (desktop wireframe)

Wireframe (mobile) | Sticky-header table

Sticky-header table UI design (mobile wireframe)

What changes on mobile

  1. Fixed in both directions: On mobile the columns do not fit and the table moves sideways too, so both the column headers and the first column stay.
  2. The frame shorter than the screen: A frame as tall as the screen would stop the page itself from scrolling.
  3. The hint above the table: People can tell that the table scrolls inside its frame.

Before you choose this pattern | Sticky-header table

Good fit

  • Many rows, so the column headers scroll out of view
  • Lists of service areas, locations or figures with more than 15–20 rows
  • Four or more columns, where a value cannot be understood without its header

Poor fit

  • Few rows, and the whole table fits on one screen (nothing needs fixing)
  • On mobile, entries are read one at a time (the <a href="/patterns/en/table-sp-cards/">mobile card table</a> works better)
  • Very many rows that people need to search through (combine the <a href="/patterns/en/table-sortable/">sortable table</a> with filtering)

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.

Share this pattern

Send this page to your team or your design partner.

Was this pattern useful?

Written by

Yuta Okano

ENVY DESIGN Inc.

CEO / Director / Designer

14 years in the web industry. Has worked on more than 500 web projects, from corporate and recruiting sites to e-commerce. Focuses on information architecture, direction and design, from planning websites to improving them. In recent years he has focused on AIO (AI optimization) and GEO, helping sites get cited by generative AI search such as ChatGPT, Perplexity and Google AI Overviews.

Review and revision history

  1. Published AvatarYuta Okano Pattern published