table { text-align: left; position: relative; border-collapse: collapse; } thead th { text-align: center; } th { position: sticky; background-color: #fff; top: 0; /* Don't forget this, required for the stickiness */ }
table { text-align: left; position: relative; border-collapse: collapse; } thead th { text-align: center; } th { position: sticky; background-color: #fff; top: 0; /* Don't forget this, required for the stickiness */ }