Get access to an awe-inspiring collection Of 87 Beautiful Wordpress themes for the price of one Get it now Ad

Bootstrap table with a fixed header

Published: 9.5.2019 | Last update: 2.7.2019

Build a Bootstrap table with a fixed header and scrollable body using Bootstrap 4. This template is responsive, so nicely displayed also on smaller viewports.

Snippet explained

  • we limit tbody height to 300px (add your value) and set overflow-y to scroll
  • then to make everything work, we have to set the table's rows and cells to display: block and float: left


Please note that the interactive editor on this page should be viewed on your laptop or desktop for the best results.

How to use the snippet

There are two ways to use the snippet:

  • a] Copy it into your project. This means:
    1. Copy content of the HTML, CSS, JavaScript tabs into your project
    2. Make sure that you have jQuery 3 and Bootstrap 4's CSS and JS included in your project too.
    3. That should be it, and you should be good to go.
  • b] Use the "Edit in JSFiddle" link in the top right and play with it in the JSFiddle. After adjusting what you need, you can use the same steps as in a] to develop it locally.
Share on Facebook Share on Twitter Share on LinkedIn