Skip to content

Add sticky table headers - #42837

Open
mdo wants to merge 2 commits into
v6-devfrom
table-sticky-headers
Open

Add sticky table headers#42837
mdo wants to merge 2 commits into
v6-devfrom
table-sticky-headers

Conversation

@mdo

@mdo mdo commented Aug 13, 2026

Copy link
Copy Markdown
Member
  • Add a .thead-sticky class that keeps a <thead> in view while the <tbody> scrolls inside a scrollable parent.
  • Add --table-thead-sticky-top and --table-thead-sticky-zindex tokens to offset fixed headers and control stacking.
  • Document the new class with a scrollable example.
  • Shorten several table headings and demote "How nesting works" to an h3.

Add a `.thead-sticky` class so a `<thead>` stays visible while the `<tbody>`
scrolls. Add `--table-thead-sticky-top` and `--table-thead-sticky-zindex`
tokens to offset fixed headers and control stacking. Document the class and
shorten several table headings.
@mdo
mdo requested a review from a team as a code owner August 13, 2026 02:25
@mdo mdo added this to v6.0.0 Aug 13, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in v6.0.0 Aug 13, 2026
Scroll a table with `.thead-sticky`: a 1px strip of the next row
shows above the header.

`border-collapse` shares that border, so `top: 0` cannot cover it.
Offset sticky `top` by the table border width and clip the example
in an `overflow-hidden` wrapper.
@coliff

coliff commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

PREVIEW:
https://deploy-preview-42837--twbs-bootstrap.netlify.app/docs/6.0/content/tables/#sticky-table-headers

Happy to see this being added. This was one of my only remaining feature requests for v6 :-)

In the example looks like the header jumps one pixel when scrolling down. Also, I would like thead-sticky to either have a bottom border by default or at least support adding the border-bottom class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants