TH in THead | TD in THead | TD in THead |
---|---|---|
TH in TBODY 1 | TD in TBODY 1 | TD in TBODY 1 |
TD in TBODY 1 | TH in TBODY 1 | TD in TBODY 1 |
TH in TBODY 2 | TD in TBODY 2 | TD in TBODY 2 |
TD in TFoot | TH in TFoot | TD in TFoot |
x
is the table
Test cellIndex, rowIndex and sectionIndex by clicking on a table cell. It will show the indices.
Test alert(x.caption.firstChild.nodeValue)
Test x.caption.firstChild.nodeValue = 'Is this the caption?'
Test alert(x.rows.length) (should be 5)
Test alert(x.rows[1].parentNode.tagName) (should be TBODY)
Test alert(x.rows[0].cells.length) (should be 3)
Test alert(document.getElementsByTagName('tr')[0].cells.length) (test for Safari; evade rows[] bugs)
Test alert(x.rows[1].cells[1].tagName) (should be TD)
Test x.rows[0].cells[1].firstChild.nodeValue = 'Change cell'
Test x.tBodies[1].innerHTML = '<tr><td colspan=3>New content</td></tr>'
Test Remove children of the second tBody and insert a new TR
Test x.tHead.innerHTML = '<tr><td colspan=3>New content</td></tr>'
Test Remove children of tHead and insert a new TR
Test x.tFoot.innerHTML = '<tr><td colspan=3>New content</td></tr>'