एचटीएमएल डोम टेबल ऑब्जेक्ट
टेबल ऑब्जेक्ट
टेबल ऑब्जेक्ट एक HTML <टेबल> तत्व का प्रतिनिधित्व करता है।
टेबल ऑब्जेक्ट तक पहुंचें
आप getElementById() का उपयोग करके <table> तत्व तक पहुंच सकते हैं:
उदाहरण
var x = document.getElementById("myTable");
एक टेबल ऑब्जेक्ट बनाएं
आप document.createElement() विधि का उपयोग करके <table> तत्व बना सकते हैं:
उदाहरण
var x = document.createElement("TABLE");
तालिका वस्तु संग्रह
Collection | Description |
---|---|
rows | Returns a collection of all <tr> elements in a table |
tBodies | Returns a collection of all <tbody> elements in a table |
तालिका वस्तु गुण
Property | Description |
---|---|
align | Not supported in HTML5. Use style.cssFloat instead. Sets or returns the alignment of a table according to surrounding text |
background | Not supported in HTML5. Use
style.background instead. Sets or returns the background image of a table |
bgColor | Not supported in HTML5. Use
style.backgroundColor instead. Sets or returns the background color of a table |
border | Deprecated. Use style.border instead. Sets or returns the width of the table border. |
caption | Returns the <caption> element of a table |
cellPadding | Not supported in HTML5. Use
style.padding instead. Sets or returns the amount of space between the cell border and cell content |
cellSpacing | Not supported in HTML5. Use style.borderSpacing instead. Sets or returns the amount of space between the cells in a table |
frame | Not supported in HTML5. Sets or returns which outer-borders (of a table) that should be displayed |
height | Not supported in HTML5. Use style.height instead. Sets or returns the height of a table |
rules | Not supported in HTML5. Sets or returns which inner-borders (between the cells) that should be displayed in a table |
summary | Not supported in HTML5. Sets or returns a description of the data in a table |
tFoot | Returns a reference to the <tfoot> element of a table |
tHead | Returns a reference to the <thead> element of a table |
width | Not supported in HTML5. Use style.width instead. Sets or returns the width of the table |
टेबल ऑब्जेक्ट मेथड्स
Method | Description |
---|---|
createCaption() | Creates an empty <caption> element and adds it to the table |
createTFoot() | Creates an empty <tfoot> element and adds it to the table |
createTHead() | Creates an empty <thead> element and adds it to the table |
deleteCaption() | Removes the first <caption> element from the table |
deleteRow() | Removes a row (<tr>) from the table |
deleteTFoot() | Removes the <tfoot> element from the table |
deleteTHead() | Removes the <thead> element from the table |
insertRow() | Creates an empty <tr> element and adds it to the table |
मानक गुण और घटनाएँ
टेबल ऑब्जेक्ट मानक गुणों और घटनाओं का भी समर्थन करता है ।
संबंधित पृष्ठ
एचटीएमएल ट्यूटोरियल: एचटीएमएल टेबल्स
HTML संदर्भ: HTML <तालिका> टैग