Connecting Tech Pros Worldwide Help | Site Map

Final width of a table?

  #1  
Old September 3rd, 2008, 08:15 AM
CKKwan
Guest
 
Posts: n/a
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!
  #2  
Old September 3rd, 2008, 01:45 PM
GArlington
Guest
 
Posts: n/a

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...
  #3  
Old September 3rd, 2008, 02:05 PM
Laser Lips
Guest
 
Posts: n/a

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);
  #4  
Old September 3rd, 2008, 05:05 PM
Martin Honnen
Guest
 
Posts: n/a

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/
  #5  
Old September 5th, 2008, 02:55 PM
sturyuu5eye@gmail.com
Guest
 
Posts: n/a

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?
  #6  
Old September 5th, 2008, 06:35 PM
Dr_KralNOSPAM@nyc.rr.com
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
More on Safari table width problem Josh Renaud answers 5 July 20th, 2005 10:35 PM
Why is Netscape 6.1 disappearing my final table row? Csaba2000 answers 3 July 20th, 2005 09:29 PM
Why is Netscape 6.1 disappearing my final table row? Csaba2000 answers 3 July 20th, 2005 11:58 AM