HTML DOM TableData Object
TableData object
The TableData object represents the HTML <td> element.
Access the TableData object
You can access the <td> element using getElementById():
var x = document.getElementById("myTd");
Tip:You can also iterate over the table rows cells collection to access the <td> element.
Create TableData Object
You can use the document.createElement() method to create a <td> element:
var x = document.createElement("TD");
TableData Object Properties
Attributes | Description |
---|---|
abbr |
Not supported in HTML5. Set or return the value of the abbr attribute. |
align |
Not supported in HTML5.Please use style.textAlign. Set or return the horizontal alignment of the content within the data cell. |
axis |
Not supported in HTML5. Set or return a comma-separated list of related data cells. |
background |
Not supported in HTML5.Please use style.background. Set or return the background image of the data cell. |
bgColor |
Not supported in HTML5.Please use style.backgroundColor. Set or return the background color of the table. |
cellIndex | Return the position of the cell in the collection of cells in the table row. |
ch |
Not supported in HTML5. Set or return the alignment character of the data cell. |
chOff |
Not supported in HTML5. Set or return the horizontal offset of the ch attribute. |
colSpan | Set or return the value of the colspan attribute. |
headers | Set or return the value of the headers attribute. |
height |
Not supported in HTML5.Please use style.height. Set or return the height of the data cell. |
noWrap |
Not supported in HTML5.Please use style.whiteSpace. Set or return whether the content in the cell can be wrapped. |
rowSpan | Set or return the value of the rowspan attribute. |
vAlign |
Not supported in HTML5.Please use style.verticalAlign. Set or return the vertical alignment of the content within the cell. |
width |
Not supported in HTML5.Please use style.width. Set or return the width of the data cell. |
Standard properties and events
The TableData object supports both standardsAttributesandEvents.