position: sticky for Table Headers in CSS


Keep table headers visible at the top of the viewport as the user scrolls.

Source Code

thead th {
    position: sticky;
    top: 0;
    background-color: #fff;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments