CSS · Snippet · ASP.net
position sticky table header
CSS to keep a table header row sticky at the top while the body rows scroll underneath it.
How to use position sticky table header:
Paste the rules into the stylesheet and reload the page that should use them.A parent element with overflow:hidden stops sticky from working. The th needs a background color or rows will show through it while scrolling. Use z-index to keep the header on top..grid thead th {
position: sticky;
top: 0;
background: #fff;
z-index: 1;
}