15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11 ✦ Table and List Objects (Chapter 27)<br />

Notice that the cells of the THEAD element are untouched by the action imposed on<br />

the TBODY element.<br />

COL and COLGROUP Element Objects<br />

Properties<br />

span<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓ ✓<br />

Example<br />

The following statement assigns a span of 3 to a newly created COLGROUP element<br />

stored in the variable colGroupA:<br />

colGroupA.span = 3<br />

TR Element Object<br />

Properties<br />

cells<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓ ✓<br />

Example<br />

Use The Evaluator (Chapter 13 in the <strong>JavaScript</strong> <strong>Bible</strong>) to retrieve the number of<br />

TD elements in the second row of the demonstrator table. Enter the following statement<br />

into the top text box (W3C DOM syntax shown here):<br />

document.getElementById(“myTable”).rows[1].cells.length<br />

height<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓<br />

391<br />

TR.height

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!