Bootstrap テーブル

❮ 前章へ 次章へ ❯

Bootstrap の基本的なテーブル

基本的な Bootstrap のテーブルには、小さなパディングと横方向の区切線だけがあります。

.table クラスは、テーブルに基本的なスタイルを追加します:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com
Try it Yourself »

ストライプ付き行

.table-striped クラスは、テーブルにストライプを追加します:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com
Try it Yourself »

ボーダー付きテーブル

.table-bordered クラスは、テーブルとセルの四辺すべてにボーダーを追加します:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com
Try it Yourself »

ホバー付き行

.table-hover クラスは、テーブルの行にホバー状態を有効にします:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com
Try it Yourself »

圧縮したテーブル

.table-condensed クラスは、セルパディングを半分にカットすることにより、テーブルをよりコンパクトにします:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com
Try it Yourself »

コンテキスト・クラス

コンテキスト・クラスは、テーブル行(<tr>)またはテーブルセル(<td>)を 着色するために使用することができます:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com
Try it Yourself »

使用することができるコンテキストクラスは次の通りです:

クラス 説明
.active テーブルの行またはテーブルセルにホバーしたときの色を適用します
.success 成功または積極的な行動を表します
.info 有益な変化またはアクションにニュートラルであることを表します
.warning 注意が必要かもしれない警告を表します
.danger 危険または潜在的に否定的な行動を表します

レスポンシブ・テーブル

.table-responsive クラスは、レスポンシブ・テーブルを作成します。 小型デバイス(768px 以下)の時には、テーブルは縦にスクロールします。 幅が 768px より大きいときは、表示する上では何の違いもありません:

<div class="table-responsive">
  <table class="table">
    ...
  </table>
</div>
Try it Yourself »

練習問題で確認!

Exercise 1 »  Exercise 2 »  Exercise 3 »  Exercise 4 »  Exercise 5 »  Exercise 6 »


完全な Bootstrap テーブル・リファレンス

全 table クラスの完全なリファレンスは、 Bootstrap テーブル・リファレンスをご覧ください。


❮ 前章へ 次章へ ❯