내가 (그래서 열 제목의 숙박 스크롤시) 고정 행 머리글와 테이블을 만들려고하고, 나는 것을 달성 할 수 있었다하지만 지금은 테이블 헤더는에를 정렬되지 않은 아래 행 나는 그것에 대해서 jsfiddle을 만들었습니다. 현재 출력 같다 : 여기서정렬 테이블 헤더
샘플 추출 HTML이다.
<head>
<style>
table
{
/*background-color: #aaa;*/
width: 800px;
}
tbody
{
/*background-color: #ddd;*/
height: 200px;
width: 800px;
overflow: auto;
}
td
{
}
thead > tr, tbody
{
display: block;
}
</style>
</head>
<body>
<div id="containerdiv" style="width: 800px">
<table id="dynamictable">
<thead>
<tr>
<th>
ID
</th>
<th>
Title
</th>
<th>
Media Title
</th>
<th>
Broadcast Time
</th>
<th>
Destination
</th>
<th>
Channel
</th>
<th>
Start Time
</th>
<th>
End Time
</th>
</tr>
</thead>
<tbody id="tablebody">
<tr id="0">
<td>
ID: 0
</td>
<td>
Some Content
</td>
<td>
Some more contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
</tr>
<tr id="1">
<td >
ID: 1
</td>
<td>
Some Content
</td>
<td>
Some more contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
</tr>
<tr id="Tr1">
<td>
ID: 1
</td>
<td>
Some Content
</td>
<td>
Some more contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
<td>
Some more contents contents contents
</td>
</tr>
</tbody>
</table>
</div>
</body>
당신이 JQuery와 사용하려고 사용하는 경우 http://www.fixedheadertable.com/ – user1759572
글쎄, 처음에는 인라인 CSS 사용을 고집한다면 동일한 너비를 머리글은 아래 셀이 있습니다. – sbeliv01
가장 쉬운 방법은 고정 너비 열을 사용하는 것입니다. 각 열 유형에 고유 한'class'를 두어 CSS에 너비를 지정하십시오. – lurker