非推奨
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.
概要
border は、テーブルのボーダー幅( border
属性の値)の取得 / 設定に用います。
構文
HTMLTableElement.border =borderWidth; //取得 borderWidth = HTMLTableElement.border; //設定
-
border
- テーブルのボーダーのピクセル幅を単位無しで取得 / 設定
例
// テーブルのボーダー幅を 2 ピクセルに設定する例 var t = document.getElementById("TableA"); // 対象とする table 要素への参照を変数 t に代入 t.border = "2"; // ボーダー幅の設定
注記
border 属性は HTML 4.0 で非推奨属性となっています。代わりに CSS の border-width
を間接的、または直接的に使用すると良いでしょう(例: table.bgColor #注記)
仕様書
- W3C DOM 2 HTML 仕様書 HTMLTableElement .border.