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

Table rows 集合

Table 對(duì)象參考手冊(cè) Table 對(duì)象

定義和用法

rows 集合返回表格中所有行(TableRow 對(duì)象)的一個(gè)數(shù)組,即一個(gè) HTMLCollection。

該集合包括 <thead>、<tfoot> 和 <tbody> 中定義的所有行。

語(yǔ)法

tableObject.rows

屬性

屬性 描述
length 返回集合中 <tr> 元素的數(shù)目

方法

Method 描述
[name_or_index] 一個(gè)整數(shù),指定元素檢索位置(從0開(kāi)始)td>
item(name_or_index) 返回集合中的指定索引的元素
namedItem(name) 返回集合中指定名稱的元素

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 rows 集合


實(shí)例

實(shí)例

顯示表格中行的數(shù)目:

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(json.cn)</title> <script> function displayResult(){ alert(document.getElementById("myTable").rows.length); } </script> </head> <body> <table id="myTable" border="1"> <tr> <td>cell 1</td> <td>cell 2</td> </tr> <tr> <td>cell 3</td> <td>cell 4</td> </tr> </table> <br> <button type="button" onclick="displayResult()">顯示表的行數(shù)</button> </body> </html>

運(yùn)行代碼 ?

實(shí)例

更多實(shí)例

彈出第一行的內(nèi)容

添加行

對(duì)齊表格行中的單元格內(nèi)容

表中的行的單元格內(nèi)容的垂直對(duì)齊

對(duì)齊單個(gè)單元格的內(nèi)容

單元格內(nèi)容的垂直對(duì)齊

改變表格單元格的內(nèi)容

合并單元格


Table 對(duì)象參考手冊(cè) Table 對(duì)象其他擴(kuò)展