Jump to content

Html table fixed headers


congay2014

Recommended Posts

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.

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.