is there a way by using html or javascript or anything else for that matter
to detirmine the actual height or width of a table or cell
for example if i only set the height to 100 and the data in the cell needs a
higher cell it expands to suit - i want to find out what the actual height
ends up ??
thanks for your help
chris 6 7646
chris wrote: is there a way by using html or javascript or anything else for that matter to detirmine the actual height or width of a table or cell
for example if i only set the height to 100
Make sure you tell it if this is 100 PIXELS (px), PERCENT (%) etc...
This is important!
and the data in the cell needs a higher cell it expands to suit - i want to find out what the actual height ends up ??
thanks for your help
chris
No, not that I know of, sorry. Annoying, isn't it?
Just work around it; use good code, learn CSS ( http://www.webmonkey.com)
and you can have per-pixel accuracy over your pages anyway.
chris wrote: is there a way by using html or javascript or anything else for that matter to detirmine the actual height or width of a table or cell
for example if i only set the height to 100 and the data in the cell needs a higher cell it expands to suit - i want to find out what the actual height ends up ??
Most browsers (Netscape 6/7, Mozilla, IE 4/5/6, Opera 7 for sure) allow
you to read the offsetWidth/offsetHeight of an element e.g.
<td id="aCell">...</td>
var cell;
if (document.getElementById) {
cell = document.getElementById('aCell');
}
else if (document.all) {
cell = document.all['aCell'];
}
if (cell) {
alert(cell.offsetWidth + 'x' + cell.offsetHeight);
}
--
Martin Honnen http://JavaScript.FAQTs.com/
"chris" wrote in message news: is there a way by using html or javascript or anything else for that matter to detirmine the actual height or width of a table or cell
Hi,
The following link from MSDN gives all the DHTML Object Model
properties that are related to the dimension and location of elements.
Worth a see.
[Measuring Element Dimension and Location] http://msdn.microsoft.com/library/de...ientheight.asp
Cheerz,
Denzil
"Will Gittoes" <As********@NoSpam.org> skrev i en meddelelse
news:1092735001.91079@ftpsrv1... chris wrote: is there a way by using html or javascript or anything else for that
matter to detirmine the actual height or width of a table or cell
for example if i only set the height to 100
Make sure you tell it if this is 100 PIXELS (px), PERCENT (%) etc... This is important!
and the data in the cell needs a higher cell it expands to suit - i want to find out what the actual
height ends up ??
thanks for your help
chris
No, not that I know of, sorry. Annoying, isn't it?
Actually, if you can set a property, then you can also read a property.
Anything else wouldn't make much sense.
Robert
noone wrote: "Will Gittoes" <As********@NoSpam.org> skrev i en meddelelse news:1092735001.91079@ftpsrv1...
chris wrote:
is there a way by using html or javascript or anything else for that matter to detirmine the actual height or width of a table or cell
for example if i only set the height to 100
Make sure you tell it if this is 100 PIXELS (px), PERCENT (%) etc... This is important!
and the data in the cell needs a
higher cell it expands to suit - i want to find out what the actual height ends up ??
thanks for your help
chris
No, not that I know of, sorry. Annoying, isn't it?
Actually, if you can set a property, then you can also read a property. Anything else wouldn't make much sense.
Robert
But that merely reads back the property you set!
If you did something in Javascript such as:
element_name = document.getElementById("ElementName");
element_name.style.height="50px"
If you then do this:
alert(element_name.style.height);
You will get 50px - no matter WHAT size it has actually been rendered
(i.e. not taking into account a giant image in the element etc.). This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Thomas Mlynarczyk |
last post by:
Hello,
How can I make an <a> element (containing text only, styled to be a box with
a border) as big as the table cell in which it resides, *without* having
specified any width/height (neither...
|
by: Dave Moore |
last post by:
Hi,
I want to use CSS to define the font size in every cell of a table. This
avoids needing to define the font size in every <TD> tag using the normal
multiple HTML <FONT SIZE="2"> notation....
|
by: DaveO |
last post by:
OK. Now I'm all googled out and still puzzled !
I admit I am very new to javascript, but think that it is the only solution
to this.
I have a web page with a table ( 2 columns, 1 row )
The...
|
by: SarahMarsden |
last post by:
I'm new to Dreamweaver (using MX 2004). I have a 2 row 3 column table.
I have set each column to 200 pixels. The second row I have merged
into one cell. When I enter text (or anything else) into...
|
by: no-spam |
last post by:
Hello,
I have an HTML question that I'm not sure can be solved. I want to
restrict the maximum size of an inline image.
For example, I can force the image to be 200x200 if I do this:
<img...
|
by: gscott66 |
last post by:
Hello,
I am fairly new to design and in particular CSS. I have a site with two
tables that I cannot seem to get sized correctly. When you view the link,
you'll notice that there is a tremendous...
|
by: Grant |
last post by:
Gday, Im using C# in a web solution.
Ive placed a WebControls.Table on my webform and am building rows and cells
during runtime.
How do I dynamically set the column width of the table according to...
|
by: patl |
last post by:
Hi all,
I am trying to write a terminal emulator using Javascript + AJAX and I
need to create an 80x25 table (each cell
contains 1 character) in which I can update the contents of each cell...
|
by: _Who |
last post by:
I spent all day yesterday trying different things.
Something has happened so I can't change font size.
I have a table and in the first cell I have only text.
I tried using the cell's Style...
|
by: chazzy69 |
last post by:
The problem is as follows, i am inputing text and images from another source via my php script, now when i try to display the text and images into a page of my own styling the text and images skewed...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |