border-collapse …… セルのボーダーの表示の仕方を指定する













































広告
border-collapseプロパティは、隣接するセルのボーダーを重ねて表示するか(collapse)、間隔をあけて表示するか(separate)を指定します。
■値
- collapse
- 隣接するセルのボーダーを重ねて表示します。
- separate
- 隣接するセルのボーダーを間隔をあけて表示します。
■使用例
スタイルシート部分は外部ファイル(sample.css)に記述。
table.sample1 {border: solid 1px #000000; border-collapse: collapse;}
table.sample2 {border: solid 1px #000000; border-collapse: separate;}
td.sample {border: solid 1px #ff0000}
HTMLソース
<html>
<head>
<link rel=”stylesheet” href=”sample.css”
type=”text/css”>
</head>
<body>
<table class=”sample1″>
<tr><td class=”sample”>春</td><td
class=”sample”>夏</td></tr>
<tr><td class=”sample”>秋</td><td
class=”sample”>冬</td></tr>
</table>
<br>
<table class=”sample2″>
<tr><td class=”sample”>春</td><td
class=”sample”>夏</td></tr>
<tr><td class=”sample”>秋</td><td
class=”sample”>冬</td></tr>
</table>
</body>
</html>
↓↓↓
ブラウザ上の表示
春 | 夏 |
秋 | 冬 |
春 | 夏 |
秋 | 冬 |
■関連項目
table-layout …… テーブル(表)の表示方法を指定する
caption-side …… テーブル(表)のキャプションの位置を指定する
border-collapse …… セルのボーダーの表示の仕方を指定する
border-spacing …… セルのボーダーの間隔を指定する
empty-cells …… 空白セルのボーダーの表示・非表示を指定する
caption-side …… テーブル(表)のキャプションの位置を指定する
border-collapse …… セルのボーダーの表示の仕方を指定する
border-spacing …… セルのボーダーの間隔を指定する
empty-cells …… 空白セルのボーダーの表示・非表示を指定する
広告