次のような HTML があります。
<article>
<header>
<hgroup>
<h1>Wk 25 </h1>
<h2>(18-06 tot 24-06)</h2>
</hgroup>
<p>Some info</p>
</header>
<table>
<thead>
<tr>
<th class="legenda">Title</th>
<th class="legenda">Title</th>
<th class="legenda">Title</th>
</tr>
</thead>
<tbody>
<tr>
<td>content</td>
<td>content</td>
<td>content</td>
</tr>
</tbody>
</table>
</article>
そしてCSS(抜粋)は次のようになります:
article {
padding: 0;
margin-bottom: 15px;
overflow: auto;
}
article header {
background: url('header.png') repeat-x bottom center;
padding: 4px 10px;
cursor: pointer;
}
article-要素はブラウザ ウィンドウに合わせてサイズ変更されます。内部のテーブルは article-element よりも広くなる可能性があるため、overflow: auto. ただし、ヘッダー要素の幅は 100% であるため、右にスクロールするとヘッダーが見えなくなります。
ヘッダーに位置を指定する場合: 絶対、固定の高さも指定する必要があります。高さはコンテンツに依存するため (変化します)、機能しません。
つまり、右にスクロールしてもヘッダーが表示されたままになることを除いて、今と同じようにレンダリングしたいということです。