Issue:
I'm facing a challenge with a table that is too large to display properly on mobile. I tried using overflow-x: auto
, which worked well but made it difficult to read the table data as the header would scroll off the screen. I find myself constantly scrolling back up to see the column headers.
Inquiry:
Is there a way to keep the table header fixed within the table itself using CSS/JS - jQuery
, so that it remains visible while scrolling through the data on mobile devices? This behavior is seen in apps like Apple Numbers and iPhone Instagram, where headers stay fixed until they are out of view. I am open to using CSS3 for this solution since it is intended for a mobile platform.
Similar Apps With Desired Behavior
- Apple Numbers: Headers remain fixed even when scrolling down.
- iPhone Instagram App: User's header stays in view as feed is scrolled.
- iPhone Contacts App: Letter section remains at the top while scrolling through contacts.
I hope this clarifies my query as I have not been able to find a similar solution online. The desired effect is a combination of float>
and fixed
.