JavaScript + Ajax 実践サンプル集 (1496本以上) ◇編集して実行可能◇
jQueryを使い倒せ! jQueryでAjaxを実装するための基礎知識と実践サンプルを一挙公開中...
jQueryテンプレート42選!
ホーム
jQuery
jQuery プラグイン
jQuery UI
人気順
カテゴリ
キーワード
クール
新着
ツリー
jQuery PDF
ホット
サイト情報
サイトマップ
★ 新着サンプルトップ50のRSSを購読する
◆ DHTMLサンプル(基礎)のRSSを購読する
◆ DHTMLサンプル(応用)のRSSを購読する
◆ AJAXサンプルのRSSを購読する
◆ その他サンプルのRSSを購読する
◆ BOM(Browser Object Model)のRSSを購読する
◆ DOM(Document Object Model)のRSSを購読する
表のヘッダー/フッターを固定 #1
説明
補足説明
コード
分割コード
関連書籍
コメント投稿
このサンプルは、スタイルシートを使用して表(table)のヘッダー/フッターを固定してスクロールさせます。表のスクロールバーを上下に移動してスクロールしてみてください。データにドロップダウンリストがあっても正常に動作します。
このサンプルを編集して試してみる
div.outerとdiv.inner要素を入れ子にしてtable要素をdiv.innderに入れ子にして実装しています。
<div class="outer"> <div class="inner"> <table summary="summary"> ::: </table> </div> </div>
Vertical Scrolling Table Method #1
caption
col1
col2
col3
col4
col5
footer
row 1
row 1.1
item1
item2
item3
row 1.2
row 1.3
row 1.4
row 2
row 2.1
row 2.2
row 2.3
row 2.4
row 3
row 3.1
row 3.2
row 3.3
row 3.4
row 4
row 4.1
row 4.2
row 4.3
row 4.4
row 5
row 5.1
row 5.2
row 5.3
row 5.4
row 6
row 6.1
row 6.2
row 6.3
row 6.4
row 7
row 7.1
row 7.2
row 7.3
row 7.4
row 8
row 8.1
row 8.2
row 8.3
row 8.4
row 9
row 9.1
row 9.2
row 9.3
row 9.4
row 10
row 10.1
item1
item2
item3
row 10.2
row 10.3
row 10.4
CSS部
ボックス内のスタイルシート(CSS)を外部ファイル(*.css)、またはHTMLドキュメントの<HEAD>セクションの<style>タグ内にコピー&ペーストしてください。
.outer { position: relative; padding: 4em 0 3em 0; width: 54em; background: #eee; margin: 0 auto 3em auto; } .inner { overflow: auto; width: 54em; height: 9.6em; background: #eee; } .outer table caption { position: absolute; width: 51.7em; text-align: center; top: 0; left: 0; height: 1.5em; background: #697210; border: 0.1em solid #fff; color: #fff; } .outer thead tr { position: absolute; top: 1.5em; height: 1.5em; left: 0; } .outer tfoot td { position: absolute; width: 51.5em; text-align: center; background: #f0c992; border: 0.1em solid #000; color: #000; bottom: 0; left: 0; } .outer th, .outer td { width: 10em; text-align: left; } .outer th { background: #724a10; color: #fff; } .outer .dk { background: #fff; } .th1 { width: 149px; } .th2 { width: 99px; } .th3 { width: 99px; } .th4 { width: 99px; } .th5 { width: 200px; } .td1 { width: 149px; } .td2 { width: 99px; } .td3 { width: 99px; } .td4 { width: 99px; } .td5 { width: 170px; }
コメント・提案の投稿!
名前
メール
件名
本文
送信中です...
ASP.NET 3.5
|
Akio's Blog