TableRow 对象表示 HTML <tr> 元素。
您可以使用 getElementById() 访问 <tr> 元素:
提示:您还可以通过搜索来访问 <tr> 元素行一个表的集合。
您可以使用 document.createElement() 方法创建 <tr> 元素:
Collection | Description |
---|---|
cells | Returns a collection of all <td> or <th> elements in a table row |
Property | Description |
---|---|
align | Not supported in HTML5. Use style.textAlign instead. Sets or returns the horizontal alignment of the content within a table row |
bgColor | Not supported in HTML5. Use style.backgroundColor instead. Sets or returns the background color of a table row |
ch | Not supported in HTML5. Sets or returns an alignment character for cells in a table row |
chOff | Not supported in HTML5. Sets or returns the horizontal offset of the ch property |
height | Not supported in HTML5. Use style.height instead. Sets or returns the height of a table row. |
rowIndex | Returns the position of a row in the rows collection of a table |
sectionRowIndex | Returns the position of a row in the rows collection of a tbody, thead, or tfoot |
vAlign | Not supported in HTML5. Use style.verticalAlign instead. Sets or returns the vertical alignment of the content within a table row |
Method | Description |
---|---|
deleteCell() | Deletes a cell from the current table row |
insertCell() | Inserts a cell into the current table row |
HTML 教程:HTML 表格
HTML 参考:HTML <tr> 标签
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!