Connecting Tech Pros Worldwide Help | Site Map

Final width of a table?

CKKwan
Guest
 
Posts: n/a
#1: Sep 3 '08
Dear All,

I specified the table width to be 50% (regardless of whether I specify
or not), but the final width of the table will be different because of
its content.

Quesion now is how can I find out the final width?

table.width or table.style.width only returns the value that I have
specify (or null if I do not specify).

Thankd in advace!
GArlington
Guest
 
Posts: n/a
#2: Sep 3 '08

re: Final width of a table?


On Sep 3, 8:07*am, CKKwan <ckk...@my-deja.comwrote:
Quote:
Dear All,
>
I specified the table width to be 50% (regardless of whether I specify
or not), but the final width of the table will be different because of
its content.
>
Quesion now is how can I find out the final width?
>
table.width or table.style.width only returns the value that I have
specify (or null if I do not specify).
>
Thankd in advace!
See DOM, Firebug in FF is your best friend for this purpose...
Laser Lips
Guest
 
Posts: n/a
#3: Sep 3 '08

re: Final width of a table?


On Sep 3, 1:44 pm, GArlington <garling...@tiscali.co.ukwrote:
Quote:
On Sep 3, 8:07 am, CKKwan <ckk...@my-deja.comwrote:
>
Quote:
Dear All,
>
Quote:
I specified the table width to be 50% (regardless of whether I specify
or not), but the final width of the table will be different because of
its content.
>
Quote:
Quesion now is how can I find out the final width?
>
Quote:
table.width or table.style.width only returns the value that I have
specify (or null if I do not specify).
>
Quote:
Thankd in advace!
>
See DOM, Firebug in FF is your best friend for this purpose...
alert(document.getElementById("yourTable").offsetW idth);
Martin Honnen
Guest
 
Posts: n/a
#4: Sep 3 '08

re: Final width of a table?


CKKwan wrote:
Quote:
Quesion now is how can I find out the final width?
tableElement.offsetWidth


--

Martin Honnen
http://JavaScript.FAQTs.com/
sturyuu5eye@gmail.com
Guest
 
Posts: n/a
#5: Sep 5 '08

re: Final width of a table?


Quote:
alert(document.getElementById("yourTable").offsetW idth);- Hide quoted text -
>
- Show quoted text -
Thanks for the answer. There is two issues.

1. I am using IIS with ASPNET, I can get the width in scrollWidth, and
clientWidth, but not offsetWidth. May I know what are the different
between these 3 values?

2. The width are not updated until it is completely render. Means if I
put a java script at the bottom of the page and try to read this
value, it will return 0. I can only read these value later (trigger by
an event, example timer / user click). Is there a better way to get
these value?
Dr_KralNOSPAM@nyc.rr.com
Guest
 
Posts: n/a
#6: Sep 5 '08

re: Final width of a table?


On Fri, 5 Sep 2008 06:53:30 -0700 (PDT), sturyuu5eye@gmail.com wrote in
<6b6d2669-ee5f-44ca-b767-4ca72f56968c@q26g2000prq.googlegroups.com>:
Quote:
>2. The width are not updated until it is completely render. Means if I
>put a java script at the bottom of the page and try to read this
>value, it will return 0. I can only read these value later (trigger by
>an event, example timer / user click). Is there a better way to get
>these value?
Perhaps <body onload="function-to-check-value()">

Closed Thread