Objet HTML DOM TableRow
Objet TableRow
L'objet TableRow représente un élément HTML <tr>.
Accéder à un objet TableRow
Vous pouvez accéder à un élément <tr> en utilisant getElementById() :
Exemple
var x = document.getElementById("myTr");
Conseil : Vous pouvez également accéder à un élément <tr> en effectuant une recherche dans la collection de lignes d'une table.
Créer un objet TableRow
Vous pouvez créer un élément <tr> en utilisant la méthode document.createElement() :
Exemple
var x = document.createElement("TR");
Collections d'objets TableRow
Collection | Description |
---|---|
cells | Returns a collection of all <td> or <th> elements in a table row |
Propriétés de l'objet 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éthodes d'objet TableRow
Method | Description |
---|---|
deleteCell() | Deletes a cell from the current table row |
insertCell() | Inserts a cell into the current table row |
Propriétés et événements standard
L'objet TableRow prend également en charge les propriétés et événements standard .
Pages connexes
Tutoriel HTML : Tableaux HTML
Référence HTML : balise HTML <tr>