WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML DOM Table Object


Table Object

The Table item speaks to a HTML <table> element.

Access a Table Object

You can get to a <table> component by utilizing getElementById():

var x = document.getElementById("myTable");

Create a Table Object

You can make a <table> component by utilizing the document.createElement() method:

var x = document.createElement("TABLE");

Table Object Collections

Collection Description
>rows Returns a gathering of all <tr> components in a table
tBodies Returns an accumulation of all <tbody> components in a table

Table Object Properties

Property Description
align Not bolstered in HTML5. Use style.cssFloat instead.
Sets or returns the arrangement of a table as indicated by encompassing text
background Not bolstered in HTML5. Use style.background instead.
Sets or returns the foundation picture of a table
bgColor Not upheld in HTML5. Use style.backgroundColor instead.
Sets or returns the foundation shade of a table
border Deprecated. Use style.border instead.
Sets or returns the width of the table border.
caption Returns the <caption> component of a table
cellPadding Not bolstered in HTML5. Use style.padding instead.
Sets or returns the measure of room between the cell outskirt and cell content
cellSpacing Not upheld in HTML5. Use style.borderSpacing instead.
Sets or returns the measure of room between the cells in a table
frame Not bolstered in HTML5.
Sets or returns which external outskirts (of a table) that ought to be displayed
height Not bolstered in HTML5. Use style.height instead.
Sets or returns the stature of a table
rules Not bolstered in HTML5.
Sets or returns which inward fringes (between the phones) that ought to be shown in a table
summary Not upheld in HTML5.
Sets or returns a portrayal of the information in a table
tFoot Returns a reference to the <tfoot> component of a table
tHead Returns a reference to the <thead> component of a table
width Not bolstered in HTML5. Use style.width instead.
Sets or returns the width of the table

Table Object Methods

Method Description
createCaption() Creates a void <caption> component and adds it to the table
createTFoot() Creates a void <tfoot> component and adds it to the table
createTHead() Creates a void <thead> component and adds it to the table
deleteCaption() Removes the first <caption> component from the table
< deleteRow() Removes a column (<tr>) from the table
< deleteTFoot() Removes the <tfoot> component from the table
deleteTHead() Removes the <thead> component from the table
insertRow() Creates a void <tr> component and adds it to the table

Related Pages

HTML tutorial: HTML Tables

HTML reference: HTML <table> tag