Fixed Table Headers

The best examples of fixed table headers I have come across are here:

In these examples the headers do not scroll horizontally. Does anyone know a good solution?

Hi, Welcome to SitePoint!

Looking at Paul’s example (that first link you gave), I don’t think you are going to be able to get the table header to scroll left. It looks like that was the reason he had made this comment on the page.

The table can be a fluid length and will resize within reasonable limits accordingly.
The problem (which is also the solution) is that the header data is nested in <p> tags which are absolute positioned. The way the overflow properties are set up on .wrap and .inner you can’t change their values or the method breaks.

I got close by adding overflow-x:auto; to .wrap but the 100% widths on .inner and table cause gaps on the right when you scroll left.

.wrap {
    margin:50px auto;
    padding:25px 0 0;
    border:1px solid #000;
.inner {