Objekt HTML DOM TableRow
Objekt TableRow
Objekt TableRow představuje prvek HTML <tr>.
Přístup k objektu TableRow
K prvku <tr> můžete přistupovat pomocí getElementById():
Příklad
var x = document.getElementById("myTr");
Tip: K prvku <tr> můžete také přistupovat vyhledáváním v kolekci řádků tabulky.
Vytvořte objekt TableRow
Element <tr> můžete vytvořit pomocí metody document.createElement():
Příklad
var x = document.createElement("TR");
Kolekce objektů TableRow
Collection | Description |
---|---|
cells | Returns a collection of all <td> or <th> elements in a table row |
Vlastnosti objektu 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 |
Metody objektu TableRow
Method | Description |
---|---|
deleteCell() | Deletes a cell from the current table row |
insertCell() | Inserts a cell into the current table row |
Standardní vlastnosti a události
Objekt TableRow také podporuje standardní vlastnosti a události .
Související stránky
HTML tutoriál: HTML tabulky
HTML reference: HTML značka <tr>