get the size of a table or cell

Discussion in 'HTML' started by chris, Aug 17, 2004.

  1. chris

    chris Guest

    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, Aug 17, 2004
    1. Advertisements

  2. chris

    Will Gittoes Guest

    Make sure you tell it if this is 100 PIXELS (px), PERCENT (%) etc...
    This is important!

    and the data in the cell needs a
    No, not that I know of, sorry. Annoying, isn't it?

    Just work around it; use good code, learn CSS (
    and you can have per-pixel accuracy over your pages anyway.
    Will Gittoes, Aug 17, 2004
    1. Advertisements

  3. chris

    Denzil Guest


    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]

    Denzil, Aug 17, 2004
  4. chris

    Denzil Guest

    Denzil, Aug 18, 2004
  5. chris

    noone Guest

    Actually, if you can set a property, then you can also read a property.
    Anything else wouldn't make much sense.

    noone, Aug 20, 2004
  6. chris

    Will Gittoes Guest

    But that merely reads back the property you set!

    If you did something in Javascript such as:
    element_name = document.getElementById("ElementName");"50px"

    If you then do this:
    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.).
    Will Gittoes, Aug 20, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.