Semantic UI - Keep thead visible when scrolling tbody

tcigrand picture tcigrand · Apr 27, 2015 · Viewed 13.3k times · Source

I'm trying to figure out how to keep the table head visible when scrolling. Is there a setting in semantic ui for this? Or will I just have to use a non-semantic ui solution?

You'll need to view "Full page" to see the table correctly.

Answer

Ashkan picture Ashkan · Nov 6, 2018

I solved the problem with position: sticky, like this:

.ui.table thead tr:first-child > th {
     position: sticky !important;
     top: 0;
     z-index: 2;
}