スタイルborderCollapseプロパティ
例
テーブルの境界線を折りたたむ:
document.getElementById("myTable").style.borderCollapse = "collapse";
以下の「自分で試してみてください」の例をもっと見てください。
定義と使用法
borderCollapseプロパティは、テーブルの境界線を1つの境界線に折りたたむかどうかを設定または返します。
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
borderCollapse | 1.0 | 5.0 | 1.0 | 1.2 | 4.0 |
構文
borderCollapseプロパティを返します。
object.style.borderCollapse
borderCollapseプロパティを設定します。
object.style.borderCollapse = "separate|collapse|initial|inherit"
プロパティ値
Value | Description |
---|---|
separate | Separate borders are drawn for all table cell elements. This is default |
collapse | Borders are not drawn between table cell elements |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 分ける |
---|---|
戻り値: | テーブルの境界を表す文字列 |
CSSバージョン | CSS2 |
その他の例
例
borderCollapseプロパティを返します。
alert(document.getElementById("myTable").style.borderCollapse);
関連ページ
CSSチュートリアル:CSSテーブル
CSSリファレンス:border-collapseプロパティ