codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  reading margins at run-time -- HELP!!!!!  shoq at 23:23 on Wednesday, August 16, 2006
 

I am trying to set a table cell height by setting a div inside it.

Thus, I want to set the div height to the overall height I desire the cell to be.

Alas, browsers include padding and borders in the offsetHeight property,but NOT margins. I need to get that to calculate properly.

Unfortunately, I can't seem to read the element.style.margin value in any possible combination. (I can get borders and padding by subtracting style.height from offsetheight)

I have tried style.marginLeft, and all permutations. I am searched the web can cannot find any reference to reading this attribute.

But surely it must be attainable. Can anyone solve this?


You would think it would simply be

val = parseInt(element.style.marginWidth,10);

but it's not.

(The parseInt() func just strips the px text from the value. eg. "100px"








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  problem in servlet
•  Re: installing DB_File on Perl Package Manager(PPM)
•  Re: Pass asp data to a javascript menu tree...
•  reading margins at run-time -- HELP!!!!!
•  Re: Need expertise - converting
•  Dynamic image dimensions
•  Dissolve effect for images using Javascript!
•  Javascript question
•  Re: urgent a j2ee problem


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006