Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Table width??


Message #1 by "MMaster23" <MMaster23@H...> on Wed, 1 Jan 2003 19:02:13
What you should try is the getElementById. I would suggest this approach:

document.getElementById("table").style.width=maxWidth

OR you could also try this (if the above doesn't work)

document.getElementById("table").setAttribute("width",maxWidth)

Please note that this method is not supported by all browsers. I think 
it's supported in IE and Netscape 7.0+, but I am not sure.

If you don't have to do this on the fly, you can do this:

document.write('<table width="' + maxWidth + '">blah</table>')

  Return to Index