congay2014 Posted September 23, 2014 Share Posted September 23, 2014 HI AllI have created a large html dynamic table using jquery .Now my query is here , How to make a fixed html table header while scrolling .can any one please hepl me how to solve ?? Quote Link to comment https://forums.phpfreaks.com/topic/291239-html-table-fixed-headers/ Share on other sites More sharing options...
kicken Posted September 23, 2014 Share Posted September 23, 2014 It can be done using CSS by separating the head/body with the appropriate <thead> and <tbody> tags, then applying overflow, height, and positioning directives as needed. Last I checked (which was a while ago admittedly) this approach had issues across different browsers. A more popular solution is to render two tables, one that contains only the headers and another inside a scrollable div with the contents. You need to specify a width for each column with this approach so that the header and body columns match. Google for HTML Table fixed header or similar terms and you can find lots of solutions. Quote Link to comment https://forums.phpfreaks.com/topic/291239-html-table-fixed-headers/#findComment-1491911 Share on other sites More sharing options...
Tom8001 Posted November 28, 2014 Share Posted November 28, 2014 You could put it inside a div & use CSS <div id="name"> your table here </div> <style> #name {position: absolute;} </style> That should keep it in one place. Quote Link to comment https://forums.phpfreaks.com/topic/291239-html-table-fixed-headers/#findComment-1497956 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.