I have a big table with about 300 rows and 12 columns. While scrolling through the table by paging through the page the <thead>
content is not displayed by default. I would like to see it while scrolling "within" <tbody>
. That is, if the top of the screen starts with a row, I want that the header is displayed first. Otherwise it should behave like a regular table.
The common solution I have seen so far is to create a table that can scroll for itself (thus independently of page scrolling). That is, what answers to this question suggest.
But this is not very practical if you have many columns spanning the screen, in particular because there are now two independent scrollbars. On mobile devices the second scrollbar takes away a lot of precious space. And it is also very irritating to use. You cannot simply "leaf through", but you have to concentrate to hit that tiny scroll bar. On other browsers you can scroll touching the data within, but once you move outside, another irritating movement happens...
Is there a clean CSS way to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…