HTML DOM Table Obheto
Table object
The Table object represents the HTML <table> element.
Access Table object
You can use getElementById() to access the <table> element:
var x = document.getElementById("myTable");
Create Table object
You can use the document.createElement() method to create a <table> element:
var x = document.createElement("TABLE");
Table object collection
Collection | Paglalarawan |
---|---|
cells | Return the collection of all <td> or <th> elements in the table. |
rows | Return the collection of all <tr> elements in the table. |
tBodies | Return the collection of all <tbody> elements in the table. |
Table object attribute
Mga Atribute | Paglalarawan |
---|---|
align |
Hindi suportado sa HTML5.Gumamit ng style.cssFloat. Set or return the alignment of the table relative to the surrounding text. |
background |
Hindi suportado sa HTML5.Gumamit ng style.background. Set or return the background image of the table. |
bgColor |
Hindi suportado sa HTML5.Gumamit ng style.backgroundColor. Set or return the background color of the table. |
border |
Deprecated.Gumamit ng style.border. Set or return the width of the table border. |
caption | Return the <caption> element of the table. |
cellPadding |
Hindi suportado sa HTML5.Gumamit ng style.padding. Set or return the space amount between the cell border and the cell content. |
cellSpacing |
Hindi suportado sa HTML5.Gumamit ng style.borderSpacing. Iset o ibalik ang dami ng espasyo sa gitna ng cell ng talahanap. |
frame |
Hindi suportado sa HTML5. Iset o ibalik ang pangngangalaga ng labi ng talahanap (labas ng talahanap). |
height |
Hindi suportado sa HTML5.Gumamit ng style.height. Iset o ibalik ang taas ng talahanap. |
rules |
Hindi suportado sa HTML5. Iset o ibalik ang pangngangalaga ng inangat ng talahanap (sa gitna ng cell). |
summary |
Hindi suportado sa HTML5. Iset o ibalik ang paglalarawan ng datos ng talahanap. |
tFoot | Ibalik ang reperensya sa <tfoot> element ng talahanap. |
tHead | Ibalik ang reperensya sa <thead> element ng talahanap. |
width |
Hindi suportado sa HTML5.Gumamit ng style.width. Iset o ibalik ang lapad ng talahanap. |
Mga Paraan ng Table Object
Mga Paraan | Paglalarawan |
---|---|
createCaption() | Lumikha ng walang laman na <caption> element at idagdag sa talahanap. |
createTFoot() | Lumikha ng walang laman na <tfoot> element at idagdag sa talahanap. |
createTHead() | Lumikha ng walang laman na <thead> element at idagdag sa talahanap. |
deleteCaption() | Alisin ang unang <caption> element mula sa talahanap. |
deleteRow() | Alisin ang isang linya (<tr>) mula sa talahanap. |
deleteTFoot() | Alisin ang <tfoot> element mula sa talahanap. |
deleteTHead() | Alisin ang <thead> element mula sa talahanap. |
insertRow() | Lumikha ng walang laman na <tr> element at idagdag sa talahanap. |
Mga Standard Atribute at Mga pangyayari
Ang Table object ay sumusuporta sa mga standardMga AtributeatMga pangyayari.