By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,672 Members | 1,284 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,672 IT Pros & Developers. It's quick & easy.

getting width of a table using javascript

P: 3
I try to get width of a table using javascript. Table width is not defined in table. It grows as per the data. Please suggest how to get table width using javascript at run time???????
Thanks in advance.
Feb 1 '07 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 15k+
P: 16,027
See the following link.
Feb 1 '07 #2

P: 3
Thanks for solution.

But this is not fulfil my requirement. What i need without assingning width(Only data is in this table) I want to get width of the table.

Here you dynamicaly(through javascript) assigned 100% and then you are getting the width. Which is not fulfil my requirement.
Feb 2 '07 #3

Expert Mod 15k+
P: 16,027
That's only an example. If you read at the top, you can use the width property to set or return the width of the table.
Feb 2 '07 #4

Expert 100+
P: 1,208
you can play around with offsetWidth i have a script around here somewhere that calculated it all right but anyways offsetWidth is pretty much your only option.
Feb 2 '07 #5

P: 2,476
yse u r right..............
Feb 3 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.