Home > OS >  Table Sticky header - Only the text is moving
Table Sticky header - Only the text is moving

Time:09-19

I am making a table using react-bootstrap HTML table

How can I make the header "background" sticky as well, so that the header can be read properly? The screenshot was taken in Firefox, though I can confirm it happens in Chrome as well.

CodePudding user response:

You probably don't need position sticky for this. Just make the tbody the part that is scrollable instead:

tbody {
  max-height: 95vh;
  overflow-y: scroll;
  display: block;
}
  • Related