Javascript Table Object
The Javascript Table object represents an HTML table. For each instance of an HTML <table> tag in a document, a Table object is created.
IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).
Javascript Table Object Collections
Collection |
Description |
IE |
F |
N |
W3C |
cells[] |
Returns an array containing each cell in the table |
5 |
|
|
No |
rows[] |
Returns an array containing each row in the table |
4 |
1 |
6 |
Yes |
tBodies[] |
Returns an array containing each tbody the table |
4 |
|
|
Yes |
Javascript Table Object Properties
Property |
Description |
IE |
F |
N |
W3C |
accessKey |
Sets or returns the keyboard key to access the table |
4 |
|
|
No |
align |
Sets or returns the alignment of the table according to the surrounding text |
4 |
1 |
6 |
Yes |
background |
Sets or returns the background image of the table |
4 |
|
|
No |
bgColor |
Sets or returns the background color of the table |
4 |
1 |
6 |
Yes |
border |
Sets or returns the width of the table border |
4 |
1 |
6 |
Yes |
borderColor |
Sets or returns the color of the table border |
5 |
|
|
No |
caption |
Sets or returns the caption of the table |
4 |
1 |
6 |
Yes |
cellPadding |
Sets or returns the amount of space between the cell border and cell content |
4 |
1 |
6 |
Yes |
cellSpacing |
Sets or returns the amount of space between cells in the table |
4 |
1 |
6 |
Yes |
cols |
Sets or returns the number of columns in the table |
4 |
|
|
No |
disabled |
Sets or returns whether or not the table should be disabled |
5 |
|
|
No |
frame |
Sets or returns which borders to render around the table |
4 |
1 |
6 |
Yes |
height |
Sets or returns the height of the table |
4 |
1 |
6 |
Yes |
id |
Sets or returns the id of the table (In IE 4 this property is read-only) |
4 |
1 |
|
No |
rules |
Sets or returns which inner-borders to display in a table |
4 |
1 |
6 |
Yes |
summary |
Sets or returns a description of the table |
6 |
1 |
6 |
Yes |
tabIndex |
Sets or returns the tab order for the table |
4 |
|
|
No |
tFoot |
Returns the TFoot object of the table |
4 |
1 |
6 |
Yes |
tHead |
Returns the THead object of the table |
4 |
1 |
6 |
Yes |
width |
Sets or returns the width of the table |
4 |
1 |
6 |
Yes |
Javascript Table Object Methods
Method |
Description |
IE |
F |
N |
W3C |
blur() |
Removes focus from the table |
4 |
|
|
No |
click() |
Simulates a mouse-click on the table |
4 |
|
|
No |
createCaption() |
Creates an empty caption element in the table |
4 |
1 |
6 |
Yes |
createTFoot() |
Creates an empty tFoot element in the table |
4 |
1 |
6 |
Yes |
createTHead() |
Creates an empty tHead element in the table |
4 |
1 |
6 |
Yes |
deleteCaption() |
Deletes the caption element and its content from the table |
4 |
1 |
6 |
Yes |
deleteRow() |
Deletes a specified row from the table |
4 |
1 |
6 |
Yes |
deleteTFoot() |
Deletes the tFoot element and its content from the table |
4 |
1 |
6 |
Yes |
deleteTHead() |
Deletes the tHead element and its content from the table |
4 |
1 |
6 |
Yes |
focus() |
Sets focus on the table |
4 |
|
|
No |
insertRow() |
Inserts a new row in the table |
4 |
1 |
6 |
Yes |
moveRow(from,to) |
Moves a row to a new position |
5 |
|
|
No |
refresh() |
Refreshes the content of the table |
4 |
|
|
No |
Javascript Table Object Events
Syntax: object.event_name="someJavaScriptCode"
Event |
Description |
IE |
F |
N |
W3C |
onBlur |
Executes some code when the table loses focus |
4 |
|
|
|
onClick |
Executes some code when the user clicks on the table |
4 |
|
|
|
onFocus |
Executes some code when the table gets focus |
4 |
|
|
|
onSelectStart |
Executes some code when the table is selected |
4 |
|
|
|
Javascript TableData Object
The TableData object represents an HTML table data element. For each instance of an HTML <td> tag in a document, a TableData object is created.
IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).
Javascript TableData Object Properties
Property |
Description |
IE |
F |
N |
W3C |
abbr |
Sets or returns an abbreviated text for the table cell (for non-visual media such as speech or Braille) |
6 |
|
|
Yes |
accessKey |
Sets or returns the keyboard key to access the table cell |
4 |
|
|
No |
align |
Sets or returns the horizontal alignment of data within the table cell |
4 |
|
|
Yes |
axis |
Sets or returns a comma-delimited list of related table cells (categories) |
6 |
|
|
Yes |
background |
Sets or returns the background image for the table cell |
4 |
|
|
No |
bgColor |
Sets or returns the background color for the table cell |
4 |
|
|
Yes |
borderColor |
Sets or returns the border color of the table cell |
4 |
|
|
No |
cellIndex |
Returns the position of the cell in the cells collection of a row |
4 |
|
|
Yes |
ch |
Sets or returns the alignment character for the table cell |
6 |
|
|
Yes |
chOff |
Sets or returns the offset of alignment character for the table cell |
6 |
|
|
Yes |
colSpan |
Sets or returns the number of columns the table cell should span |
4 |
|
|
Yes |
disabled |
Sets or returns whether or not the table cell should be disabled |
5 |
|
|
No |
headers |
Sets or returns a list of space-separated header cell ids |
6 |
|
|
Yes |
height |
Sets or returns the height of the table cell |
4 |
|
|
No |
id |
Sets or returns the id of the table cell (In IE 4 this property is read-only) |
4 |
|
|
No |
innerHTML |
Sets or returns the HTML between the start and end tags of the table cell |
4 |
|
|
No |
innerText |
Sets or returns the text between the start and end tags of the table cell |
4 |
|
|
No |
noWrap |
Sets or returns a Boolean value indicating whether or not the browser automatically performs word wrap in the table cell |
4 |
|
|
Yes |
outerHTML |
Sets or returns the table data object and its content in HTML |
4 |
|
|
No |
outerText |
Sets or returns the text of the table data object |
4 |
|
|
No |
rowSpan |
Sets or returns the number of rows the table cell should span |
4 |
|
|
Yes |
scope |
|
6 |
|
|
Yes |
tabIndex |
Sets or returns the tab order for the table cell |
4 |
|
|
No |
vAlign |
Sets or returns how cell content are vertically aligned |
4 |
|
|
Yes |
width |
Sets or returns the width of the table cell |
4 |
|
|
Yes |
Javascript TableData Object Methods
Method |
Description |
IE |
F |
N |
W3C |
blur() |
Removes focus from the table cell |
4 |
|
|
No |
click() |
Simulates a mouse-click on the table cell |
4 |
|
|
No |
focus() |
Sets focus on the table cell |
4 |
|
|
No |
Javascript TableData Object Events
Syntax: object.event_name="someJavaScriptCode"
Event |
Description |
IE |
F |
N |
W3C |
onBlur |
Executes some code when the table cell loses focus |
4 |
|
|
|
onClick |
Executes some code when the user clicks on the table cell |
4 |
|
|
|
onFocus |
Executes some code when the table cell gets focus |
4 |
|
|
|
onSelectStart |
Executes some code when the table cell is selected |
4 |
|
|
|
Javascript TableHeader Object
The TableHeader object represents an HTML table header element. For each instance of an HTML <th> tag in a document, a TableHeader object is created.
IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).
Javascript TableHeader Object Properties
Property |
Description |
IE |
F |
N |
W3C |
abbr |
Sets or returns an abbreviated text for the table header cell (for non-visual media such as speech or Braille) |
6 |
|
|
Yes |
accessKey |
Sets or returns the keyboard key to access the table header cell |
5 |
|
|
No |
align |
Sets or returns the horizontal alignment of data within the table header cell |
4 |
|
|
Yes |
axis |
Sets or returns a comma-delimited list of related table header cells (categories) |
6 |
|
|
Yes |
background |
Sets or returns the background image for the table header cell |
4 |
|
|
No |
bgColor |
Sets or returns the background color for the table header cell |
4 |
|
|
Yes |
borderColor |
Sets or returns the border color of the table header cell |
4 |
|
|
No |
cellIndex |
Returns the position of the cell in the cells collection of a row |
4 |
|
|
Yes |
ch |
Sets or returns the alignment character for the table header cell |
6 |
|
|
Yes |
chOff |
Sets or returns the offset of alignment character for the table header cell |
6 |
|
|
Yes |
colSpan |
Sets or returns the number of columns the table header cell should span |
4 |
|
|
Yes |
headers |
Sets or returns a list of space-separated header cell ids |
6 |
|
|
Yes |
height |
Sets or returns the height of the table header cell |
4 |
|
|
No |
id |
Sets or returns the id of the table header cell (In IE 4 this property is read-only) |
4 |
|
|
No |
innerHTML |
Sets or returns the HTML between the start and end tags of the table header cell |
4 |
|
|
No |
innerText |
Sets or returns the text between the start and end tags of the table header cell |
4 |
|
|
No |
noWrap |
Sets or returns a Boolean value indicating whether or not the browser automatically performs word wrap in the table header cell |
4 |
|
|
Yes |
outerHTML |
Sets or returns the table header object and its content in HTML |
4 |
|
|
No |
outerText |
Sets or returns the text of the table header object |
4 |
|
|
No |
rowSpan |
Sets or returns the number of rows the table header cell should span |
4 |
|
|
Yes |
scope |
|
6 |
|
|
Yes |
tabIndex |
Sets or returns the tab order for the table header cell |
5 |
|
|
No |
vAlign |
Sets or returns how header cell content are vertically aligned |
4 |
|
|
Yes |
width |
Sets or returns the width of the table header cell |
4 |
|
|
Yes |
Javascript TableHeader Object Methods
Method |
Description |
IE |
F |
N |
W3C |
blur() |
Removes focus from the table header cell |
5 |
|
|
No |
click() |
Simulates a mouse-click on the table header cell |
4 |
|
|
No |
focus() |
Sets focus on the table header cell |
5 |
|
|
No |
Javascript TableHeader Object Events
Syntax: object.event_name="someJavaScriptCode"
Event |
Description |
IE |
F |
N |
W3C |
onBlur |
Executes some code when the table header cell loses focus |
5 |
|
|
|
onClick |
Executes some code when the user clicks on the table header cell |
4 |
|
|
|
onFocus |
Executes some code when the table header cell gets focus |
5 |
|
|
|
onSelectStart |
Executes some code when the table header cell is selected |
4 |
|
|
|
Javascript TableRow Object
The TableRow object represents an HTML table row element. For each instance of an HTML <tr> tag in a document, a TableRow object is created.
IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).
Javascript TableRow Object Collections
Collection |
Description |
IE |
F |
N |
W3C |
cells[] |
Returns an array containing each column in the table row |
4 |
|
|
Yes |
Javascript TableRow Object Properties
Property |
Description |
IE |
F |
N |
W3C |
accessKey |
Sets or returns the keyboard key to access the table row |
5 |
|
|
No |
align |
Sets or returns the horizontal alignment of data within cells of the table row |
4 |
|
|
Yes |
bgColor |
Sets or returns the background color for the table row |
4 |
|
|
Yes |
borderColor |
Sets or returns the border color of the table row |
4 |
|
|
No |
ch |
Sets or returns the alignment character for cells in the table row |
6 |
|
|
Yes |
chOff |
Sets or returns the offset of alignment character for cells in the table row |
6 |
|
|
Yes |
disabled |
Sets or returns whether or not the table row should be disabled |
5 |
|
|
No |
height |
Sets or returns the height of the table row |
5 |
|
|
No |
id |
Sets or returns the id of the table row (In IE 4 this property is read-only) |
4 |
|
|
No |
innerHTML |
Sets or returns the HTML between the start and end tags of the table row |
5 |
|
|
No |
innerText |
Sets or returns the text between the start and end tags of the table row |
5 |
|
|
No |
outerHTML |
Sets or returns the table row object and its content in HTML |
4 |
|
|
No |
outerText |
Sets or returns the text of the table row object |
4 |
|
|
No |
rowIndex |
Returns the table row object's position in the rows collection for the table |
4 |
|
|
Yes |
sectionRowIndex |
Returns the table rows object's position in the tBody, tHead, or tFoot rows collection |
4 |
|
|
Yes |
tabIndex |
Sets or returns the tab order for the table row |
5 |
|
|
No |
vAlign |
Sets or returns how cell content are vertically aligned within the table row |
4 |
|
|
Yes |
width |
Sets or returns the width of the table row |
4 |
|
|
No |
Javascript TableRow Object Methods
Method |
Description |
IE |
F |
N |
W3C |
blur() |
Removes focus from the table row |
4 |
|
|
No |
click() |
Simulates a mouse-click on the table row |
4 |
|
|
No |
deleteCell([i]) |
Deletes a cell in the table row |
4 |
|
|
Yes |
focus() |
Sets focus on the table row |
5 |
|
|
No |
insertCell() |
Inserts a new table cell in the table row |
4 |
|
|
Yes |
Javascript TableRow Object Events
Syntax: object.event_name="someJavaScriptCode"
Event |
Description |
IE |
F |
N |
W3C |
onBlur |
Executes some code when the table row loses focus |
4 |
|
|
|
onClick |
Executes some code when the user clicks on the table row |
4 |
|
|
|
onFocus |
Executes some code when the table row gets focus |
4 |
|
|
|
onSelectStart |
Executes some code when the table row is selected |
4 |
|
|
|
|