/*#### this is for a fixed header table (ie8 does not work but degrades nicely) ####*/
/* REQUIRES: that every td/th has a width */
/* REQUIRES: that the tbody has a height */
/* REQUIRES: that header record is in a thead */
td {
display:block;
width:200px;/* this is up to the user (can be an inline style)*/
float: left;
/* after this is optional code */
border-right: 1px solid #AAAAAA;
border-bottom: 1px solid #AAAAAA;
}
th {
display:block;
width:200px;/* this is up to the user (can be an inline style)*/
float: left;
/* after this is optional code */
border-right: 1px solid #AAAAAA;
border-bottom: 2px solid #000000;
}
tbody {
display:block;
height: 100px;/* this is up to the user (can be an inline style)*/
overflow:auto;
}
/* OPTIONAL */
table {
border: 2px solid #000000;
}
.scrollbar {
width:14px;
height:18px;
}
JavaScript
// this is a table with a fixed header but scrolling records
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.