question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Table] Sticky header in group

See original GitHub issue

When the stickyHeader option is enabled on a Table and the table contains multiple header rows, only the last of the rows ends up being sticky.

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Only the last of the header rows is sticky.

Expected Behavior 🤔

All header rows should be sticky.

Steps to Reproduce 🕹

https://codesandbox.io/s/ymv2c

Tech Version
Material-UI v4.11.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
oliviertassinaricommented, Oct 16, 2020
          <TableHead>
            <TableRow>
              <TableCell align="center" colSpan={columns.length}>
                Another header row
              </TableCell>
            </TableRow>
            <TableRow>
              <TableCell
                style={{ top: 57 }}
                align="center"
                colSpan={columns.length}
              >

https://codesandbox.io/s/material-demo-forked-g12em?file=/demo.tsx

0reactions
oliviertassinaricommented, Oct 16, 2020

I presume it’s not possible to apply the stickiness props to the element itself in order to avoid the custom top offset styling.

It’s not possible, to apply the sticky position on the thead, as far as I know. This would have been ideal.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Position Sticky and Table Headers | CSS-Tricks
Sticky Headers : 5 Ways to Make Them Better. Page Laubheimer says that if you're going to do a sticky header... Keep it...
Read more >
How to stick table header(thead) on top while scrolling down ...
This can now be done without JS, just pure CSS. So, anyone trying to do this for modern browsers should look into using...
Read more >
Sticky table headers - CSS Layout
Create sticky table headers with CSS.
Read more >
How to create a table with fixed header and scrollable body
The purpose of this article is to create a table with a fixed header and scrollable body. We can create such a table...
Read more >
Fixed Table Headers - Adrian Roselli
The different z-index values help ensure your column headers sit in front of your row headers. Otherwise the visible row header will look...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found