's really into 対応 ブラウザのバージョン
- Internet Explorer 9/10/11
- Firefox 29
- Google Chrome 34
- Safari 5
- Opera 12
Method of fixing the head of the table
<table class= "Table-design tablelock1";
<thead>
<tr>
<th>tableheader1</th ><th>tableheader2</th>
<th>TableHeader3</th><th>TableHeader4</th>
</tr>
</thead>
<tbody>
<tr>
<td>Contents1</td><td> Contents2</td>
<td>contents3</td><td>contents4</td>
</tr>
<tr
<td>contents5</td><td>contents6</td>
<td>contents7</td><td >contents8</td>
</tr>
<tr>
<td>contents9</td><td>contents10 </td>
<td>contents11</td><td>contents12</td>
</tr>
</tbody>
</table>
. table-design{
Border-collapse:collapse;
border:1px solid #666;
Text-align:center;
Vertical-align:middle;
margin-bottom:30px;
}
. table-design th{
Background: #ccc;
border:1px solid #aaa;
padding:25px 5px;
}
. table-design td{
border:1px solid #aaa;
padding:25px 5px;
}
. Tablelock1 thead{
Display:block;
width:482px; /* 500px-スクロールバー*/
}
. Tablelock1 tbody{
Overflow-x: Hidden;
Overflow-y: auto;
-ms-overflow-x: Hidden;
-ms-overflow-y: auto;
Position:absolute;
Display:block;
height:100px;
width:500px;
}
. tablelock1st
,. Tablelock1 TD
{
width:110px;
}
Content source
http://webnonotes.com/css/table-header/
Fixed table header css&jquery