中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Style tableLayout 屬性

Style 對象參考手冊 Style 對象

定義和用法

tableLayout 屬性設(shè)置或返回表格單元格、行、列的顯示算法規(guī)則。

語法

設(shè)置 tableLayout 屬性:

Object.style.tableLayout="automatic|fixed|inherit"

返回 tableLayout 屬性:

Object.style.tableLayout
描述
auto 默認(rèn)。列寬度由單元格內(nèi)容設(shè)定。
  • 這種布局有時是緩慢的,因為它需要在表格完全顯示之前訪問所有內(nèi)容。
fixed 列寬度由表格寬度和列寬度設(shè)定(不是由單元格內(nèi)容設(shè)定)。
  • fixed 布局的速度比 auto 布局快,因為用戶代理在接收到第一行后就可以顯示表格。
inherit tableLayout 屬性的值從父元素繼承。

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 tableLayout 屬性。

注意:IE7 及更早的版本不支持 "inherit" 值。IE8 只有規(guī)定了 !DOCTYPE 才支持 "inherit"。IE9 支持 "inherit"。


實例

實例

設(shè)置固定的表格布局:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小白教程(json.cn)</title>
<script>
function displayResult(){
????document.getElementById("myTable").style.tableLayout="fixed";
}
</script>
</head>
<body>

<table id="myTable" width="300" border="1">
????<thead>
????????<th>表格表頭</th>
????????<th>表格表頭</th>
????</thead>
????<tbody>
????<tr>
????????????<td>這是一些文本。這是一些文本。</td>
????????????<td>這是另一些文本</td>
????</tr>
????</tbody>
</table>
<br>
<button type="button" onclick="displayResult()">設(shè)置固定的表格布局</button>

</body>
</html>

運行代碼 ?

Style 對象參考手冊 Style 對象其他擴(kuò)展