Previous Demo Back to the Codrops Article

Sticky Table Headers Revisited Creating functional and flexible sticky table headers

Wide tables are also supported.

Table set to overflow on the horizontal x axis:

The table below is allowed to overflow along the x-axis because of excessive width, making data in the rightmost columns inaccessible. This is circumvented by allowing the wrapping parent to overflow.

PopulationAlphaBetaGammaDeltaEpsilonZetaEtaThetaIotaKappaLambdaMuNuXiOmicronPiRhoSigmaTauUpsilon
Sample #12388826783813791961339598108770547275
Sample #21421202196860732229949496658108241965
Sample #34508972999024869544329718908193848515
Sample #410Parse error32455329353575969669342818572701538
Sample #58542715630341879499242096629013384796
Sample #6188085659939361491045393614802605381
Sample #7308146507160833873435743431971040959293
Sample #82388826783813791961339598108770547275
Sample #91421202196860732229949496658108241965
Sample #104508972999024869544329718908193848515
Sample #1110Parse error32455329353575969669342818572701538
Sample #128542715630341879499242096629013384796
Sample #13188085659939361491045393614802605381
Sample #14308146507160833873435743431971040959293
Sample #152388826783813791961339598108770547275
Sample #161421202196860732229949496658108241965
Sample #174508972999024869544329718908193848515
Sample #1810Parse error32455329353575969669342818572701538
Sample #198542715630341879499242096629013384796
Sample #20188085659939361491045393614802605381
Sample #21308146507160833873435743431971040959293
Sample #222388826783813791961339598108770547275
Sample #231421202196860732229949496658108241965
Sample #244508972999024869544329718908193848515
Sample #2510Parse error32455329353575969669342818572701538
Sample #268542715630341879499242096629013384796
Sample #27188085659939361491045393614802605381
Sample #28308146507160833873435743431971040959293

Table set to overflow along both horizontal and vertical (x and y) axes:

In some situations, when encountered with a very huge data set, it is hard to fit the whole table on the page. In this case, we can selectively allow certain tables to overflow on both axis. Since vertical overflow is hidden in basic usage, we can allow this by giving the table an overflow-y: auto property. This property will be detected by the wrapping parent, allowing its content to overflow in both axes.

PopulationAlphaBetaGammaDeltaEpsilonZetaEtaThetaIotaKappaLambdaMuNuXiOmicronPiRhoSigmaTauUpsilon
Sample #12388826783813791961339598108770547275
Sample #21421202196860732229949496658108241965
Sample #34508972999024869544329718908193848515
Sample #410Parse error32455329353575969669342818572701538
Sample #58542715630341879499242096629013384796
Sample #6188085659939361491045393614802605381
Sample #7308146507160833873435743431971040959293
Sample #829918592284292825631897875953747216211
Sample #945962560566748730641003872836135968449
Sample #10666325286783251001898927340788899307488
Sample #118349563837177433557695345391399351556
Sample #122819379567706258962540493544676733891
Sample #1385170313242917551773553779177555474241
Sample #149359476875613734443659953110116298345893
Sample #158128368885666668786495593515518459292235
Sample #16719078602861882234811799319743155107095
Sample #1764174971644381495706997641778399435433
Sample #1820361003535229982230454980482011311412
Sample #192374724399Parse error963495956101953217175555182
Sample #20168817856454167127083738519451385536
Sample #213534697810893881955137495066171599195429
Sample #22886597733874928675773428311278257960886
Sample #238618113770862650248291570297415864214
Sample #248062692590162793705389603931436794313891
Sample #259480131165208586516715543475877911433252

eu, magna. Suspendisse facilisis gravida, nisl pellentesque sagittis vel, accumsan fringilla orci. Ut rhoncus dolor ac nibh ut justo. Vivamus faucibus vestibulum. Nunc ut venenatis nulla.