HTML DOM TableRij- object
TabelRij Object
Het TableRow-object vertegenwoordigt een HTML <tr>-element.
Toegang tot een TableRow-object
U kunt toegang krijgen tot een <tr> -element met getElementById():
Voorbeeld
var x = document.getElementById("myTr");
Tip: U kunt ook toegang krijgen tot een <tr>-element door te zoeken in de rijenverzameling van een tabel.
Een TableRow-object maken
U kunt een <tr>-element maken door de methode document.createElement() te gebruiken:
Voorbeeld
var x = document.createElement("TR");
TableRij-objectverzamelingen
Collection | Description |
---|---|
cells | Returns a collection of all <td> or <th> elements in a table row |
Eigenschappen van tabelrij-object
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 |
Methoden voor TableRow-objecten
Method | Description |
---|---|
deleteCell() | Deletes a cell from the current table row |
insertCell() | Inserts a cell into the current table row |
Standaard eigenschappen en evenementen
Het TableRow-object ondersteunt ook de standaardeigenschappen en gebeurtenissen .
Gerelateerde pagina's
HTML-zelfstudie: HTML-tabellen
HTML-referentie: HTML <tr>-tag