此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

HTMLTableElement.rows

基线 广泛可用

自 2015年7月 起,此特性已在主流浏览器中得到支持,可在大多数设备和浏览器版本中正常使用。

表中所有行的

HTMLTableElement.rows 只读属性返回表中所有行的一个活的 HTMLCollectionHTMLTableElement.rows 包括与之相关的<thead>, <tfoot><tbody> 元素。

Although the property is read-only, the returned object is live and allows the modification of its content.

Syntax

HTMLCollectionObject = table.rows

Example

js
myrows = mytable.rows;
firstRow = mytable.rows[0];
lastRow = mytable.rows[mytable.rows.length - 1];

Specification