Size of Element

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    Size of Element

    Is there a way to determine the height of a table. I have a table that is
    built dynamically and contained in a div element. I want to be able to
    position this div element based on the size of the table contained within
    it.

    <div id="div1"></div>

    in my script I do something like this...

    document.all[div1].innerHTML = '<table border="0" width="300"
    cellspacing="0" cellpadding="0" >' +
    '<tr><td width="100%" bgcolor="#00000 0">' + tContent +
    '</td></tr></table>'

    tContent is a variable that can contain text that is chosen dynamically
    based on user input. Basically what I want to do is determine the height of
    the table so I can make sure the table is positioned so that it does not
    display beyond the top or bottom edge of the page.

    Thanks for any help...

    Steve


  • Mosley Jones III

    #2
    Re: Size of Element


    "Steve" <az.cygnus@cox. net> wrote in message
    news:7HpSa.1389 3$u51.9836@fed1 read05...[color=blue]
    > Is there a way to determine the height of a table. I have a table that is
    > built dynamically and contained in a div element. I want to be able to
    > position this div element based on the size of the table contained within
    > it.
    >
    > <div id="div1"></div>
    >
    > in my script I do something like this...
    >
    > document.all[div1].innerHTML = '<table border="0" width="300"
    > cellspacing="0" cellpadding="0" >' +
    > '<tr><td width="100%" bgcolor="#00000 0">' + tContent +
    > '</td></tr></table>'
    >[/color]



    function window_onload() {
    x = mytab.offsetHei ght
    alert(x)
    }








    [color=blue]
    > tContent is a variable that can contain text that is chosen dynamically
    > based on user input. Basically what I want to do is determine the height[/color]
    of[color=blue]
    > the table so I can make sure the table is positioned so that it does not
    > display beyond the top or bottom edge of the page.
    >
    > Thanks for any help...
    >
    > Steve
    >
    >[/color]


    Comment

    Working...