473,500 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!
Sep 3 '08 #1
5 1170
On Sep 3, 8:07*am, CKKwan <ckk...@my-deja.comwrote:
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...
Sep 3 '08 #2
On Sep 3, 1:44 pm, GArlington <garling...@tiscali.co.ukwrote:
On Sep 3, 8:07 am, CKKwan <ckk...@my-deja.comwrote:
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...
alert(document.getElementById("yourTable").offsetW idth);
Sep 3 '08 #3
CKKwan wrote:
Quesion now is how can I find out the final width?
tableElement.offsetWidth
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 3 '08 #4
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?
Sep 5 '08 #5
On Fri, 5 Sep 2008 06:53:30 -0700 (PDT), st*********@gmail.com wrote in
<6b**********************************@q26g2000prq. googlegroups.com>:
>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()">

Sep 5 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1593
by: Csaba2000 | last post by:
I apologize for the length of the page below, but I've tried to whittle it down as much as I can. The problem is that Netscape 6.1 on my Win 2K Pro machine is disappearing the final row of the...
7
12163
by: Graham J | last post by:
Apologies for the partial post that mysteriously escaped as I was composing. I shall try again. For many years I have been happily and successfully coding tables such that the WIDTH specified...
4
26197
by: N. Demos | last post by:
The following code renders as intended in IE (A TABLE, with cells of fixed width and height, inside of a DIV with fixed width and height and overflow set to hidden.) In Firefox, the table cells...
0
3054
by: javaguy | last post by:
I have a table I hide show/hide through a pair of divs. The show/hide part works fine in both Mozilla and MSIE. When switching between the hide and show versions the Mozilla browser keeps them in...
4
6135
by: Alex Meier | last post by:
I have the following problem: I need a simple, tabular layout in a webshop. - left column: navigation column with approx. 170px width - right column: content area the goal: the left column...
5
169706
by: Jean Pion | last post by:
Dear readers, Can anyone explain how to set column width of a table in ccs. I use the following style in an external stylesheet: table.tbl { table-layout:fixed; border-top: 5px solid #333;...
2
1450
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild,...
6
4957
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
5
11000
by: Taras_96 | last post by:
Hi everyone, Can anyone tell me why the top paragraph block stretches across the screen (as you would expect), while the bottom div doesn't stretch across the entire screen? When I set the width...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.