एचटीएमएल डोम टेबलरो ऑब्जेक्ट
टेबलरो ऑब्जेक्ट
TableRow ऑब्जेक्ट एक HTML <tr> तत्व का प्रतिनिधित्व करता है।
टेबलरो ऑब्जेक्ट तक पहुंचें
आप getElementById() का उपयोग करके <tr> तत्व तक पहुंच सकते हैं:
उदाहरण
var x = document.getElementById("myTr");
युक्ति: आप किसी तालिका के पंक्तियों के संग्रह के माध्यम से खोज कर <tr> तत्व तक भी पहुंच सकते हैं ।
एक टेबलरो ऑब्जेक्ट बनाएं
आप document.createElement() विधि का उपयोग करके <tr> तत्व बना सकते हैं:
उदाहरण
var x = document.createElement("TR");
TableRow वस्तु संग्रह
Collection | Description |
---|---|
cells | Returns a collection of all <td> or <th> elements in a table row |
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 |
टेबलरो ऑब्जेक्ट मेथड्स
Method | Description |
---|---|
deleteCell() | Deletes a cell from the current table row |
insertCell() | Inserts a cell into the current table row |
मानक गुण और घटनाएँ
TableRow ऑब्जेक्ट मानक गुणों और घटनाओं का भी समर्थन करता है ।
संबंधित पृष्ठ
एचटीएमएल ट्यूटोरियल: एचटीएमएल टेबल्स
HTML संदर्भ: HTML <tr> टैग