How do I find the width of a table or columns in a table without specifying it in HTML or Javascript?
For example:
<table id='myTable'> <tr><td>column a</td><td>column b</td></tr> </table>
In Javascript:
var tbl = document.getElementByID('myTable'); alert(tbl.style.width); //will be undefined
There is no direct correspondense between CSS style keywords and javascript keywords. In your case, you need tbl.offsetWidth, not tbl.style.width. See this quirksmode article for starters.