Objeto HTML DOM TableRow
Objeto TableRow
El objeto TableRow representa un elemento HTML <tr>.
Acceder a un objeto TableRow
Puede acceder a un elemento <tr> usando getElementById():
Ejemplo
var x = document.getElementById("myTr");
Sugerencia: también puede acceder a un elemento <tr> buscando en la colección de filas de una tabla.
Crear un objeto TableRow
Puede crear un elemento <tr> utilizando el método document.createElement():
Ejemplo
var x = document.createElement("TR");
Colecciones de objetos TableRow
Collection | Description |
---|---|
cells | Returns a collection of all <td> or <th> elements in a table row |
Propiedades del objeto TableRow
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 |
Métodos de objeto TableRow
Method | Description |
---|---|
deleteCell() | Deletes a cell from the current table row |
insertCell() | Inserts a cell into the current table row |
Propiedades y eventos estándar
El objeto TableRow también admite las propiedades y eventos estándar .
páginas relacionadas
Tutorial de HTML: tablas HTML
Referencia HTML: etiqueta HTML <tr>