スタイルtableLayoutプロパティ
例
固定テーブルレイアウトを設定します。
document.getElementById("myTable").style.tableLayout = "fixed";
定義と使用法
tableLayoutプロパティは、テーブルのセル、行、および列をレイアウトする方法を設定または返します。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
tableLayout | Yes | Yes | Yes | Yes | Yes |
構文
tableLayoutプロパティを返します。
object.style.tableLayout
tableLayoutプロパティを設定します。
object.style.tableLayout = "auto|fixed|initial|inherit"
プロパティ値
Value | Description |
---|---|
auto | Column width is set by the widest unbreakable content. This is default.
|
fixed | Column width is set by the width of table and columns (not the content of the cells)
|
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 自動 |
---|---|
戻り値: | テーブルに使用されるテーブルレイアウトアルゴリズムを表す文字列 |
CSSバージョン | CSS2 |
その他の例
例
テーブルレイアウトを返します。
alert(document.getElementById("myTable").style.tableLayout);
関連ページ
CSSチュートリアル:CSSテーブル
CSSリファレンス:table-layoutプロパティ
❮スタイルオブジェクト