Home » ★スタイルシートリファレンス

★スタイルシートリファレンス

border-collapse …… セルのボーダーの表示の仕方を指定する
Internet Explorer5Internet Explorer5.5Internet Explorer6Internet Explorer7Internet Explorer8Internet Explorer9
Netscape7Netscape8
Opera6Opera7Opera8Opera9Opera10
Firefox1Firefox2Firefox3Firefox4
Google Chrome1Google Chrome2Google Chrome3Google Chrome4Google Chrome5Google Chrome6
広告



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 …… 空白セルのボーダーの表示・非表示を指定する
広告



Lorem Ipsum is simply dummy text

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.