[SOLVED] Is it possible to lock a HTML table's header row position but still allowing the table body to scroll up/down? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

[SOLVED] Is it possible to lock a HTML table's header row position but still allowing the table body to scroll up/down?

I am practicing to populate a CSV file content into a HTML table. I have done the code, but I need guidance. I don't want the table's header row to move up out of sight when I'm scrolling the page down, I want it to stay where it is. Is there a way to this perhaps using CSS? I would prefer not to use a framework if I can help it. Code link below ... Thank you in advance 🙏 https://code.sololearn.com/WeKT6ZjL9wZM/?ref=app

30th Sep 2021, 1:02 AM
Ipang
7 Answers
+ 4
search for "sticky nav" same concept...
30th Sep 2021, 1:18 AM
Lisa F
Lisa F - avatar
+ 2
Ipang you can run Sololearn playground from PC browser
30th Sep 2021, 4:12 PM
Calviղ
Calviղ - avatar
+ 1
Lisa F Thank you for the hint, I will look it up 🙏
30th Sep 2021, 1:36 AM
Ipang
+ 1
https://code.sololearn.com/WwcmgO4RR9J6/?ref=app Try it on PC, since position: fixed maybe not work on WebView .
30th Sep 2021, 3:46 PM
Calviղ
Calviղ - avatar
0
Thank you for the time Calvin, I've searched for solution to this case, and I saw a lot of people say this is tricky issue and browser compatibility issues for available solutions are present. Is that why the code still allows the header row to scroll in SoloLearn app? I haven't tested it in browser though, copy paste from SoloLearn to local file is quite a hassle in a phone 😁
30th Sep 2021, 4:04 PM
Ipang
0
Calvin, I meant to test it offline, where there's no interference from SoloLearn Code Playground background feature.
30th Sep 2021, 4:15 PM
Ipang
0
Calvin, Currently I have no access to a PC/laptop either 😁
30th Sep 2021, 4:38 PM
Ipang