Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 3rd, 2008, 08:15 AM
CKKwan
Guest
 
Posts: n/a
Default Final width of a table?

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
Default 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
Default 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
Default 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
Default 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
Default 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()">

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles