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
• SoftIce Driver Suite 3.0.1
• metrowerks codewarrior 9.0
• Mapinfo.Professional.v7.0
• GardenGraphics DynaSCAPE Professional 3.02
• Embroidery Great Notions 2004 part01-74
• EFI_BEST_COLORPROOF_V5.0
• AViD.SOFTiMAGE.XSi.V4.2.CD1-NNiSO
• AUTOFX.PHOTOGRAPHIC.EDGES.6.0.CD1
• 0 STI.SASSPro.v2.0.0.2 working full


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2014