Table size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • f1crazed@gmail.com

    #1

    Table size

    Hello

    I have a table that I am trying to get the size of:

    document.getEle mentById("tblma in").height

    But if I don't set the height of the table, the statment above returns
    nothing. I have text that is dynamicaly created and I want to know the
    height of the table once the text has been entered in the table.

    Thanks for any help!

    JD

  • Mick White

    #2
    Re: Table size

    f1crazed@gmail. com wrote:[color=blue]
    > Hello
    >
    > I have a table that I am trying to get the size of:
    >
    > document.getEle mentById("tblma in").height
    >
    > But if I don't set the height of the table, the statment above returns
    > nothing. I have text that is dynamicaly created and I want to know the
    > height of the table once the text has been entered in the table.
    >[/color]


    AFAIK, there is no such attribute as table height.
    You could place the table in a <div>, I believe then you may divine the
    height.


    Mick

    Comment

    • RobB

      #3
      Re: Table size

      f1cra...@gmail. com wrote:[color=blue]
      > Hello
      >
      > I have a table that I am trying to get the size of:
      >
      > document.getEle mentById("tblma in").height
      >
      > But if I don't set the height of the table, the statment above[/color]
      returns[color=blue]
      > nothing. I have text that is dynamicaly created and I want to know[/color]
      the[color=blue]
      > height of the table once the text has been entered in the table.
      >
      > Thanks for any help!
      >
      > JD[/color]

      The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.


      Comment

      • Grant Wagner

        #4
        Re: Table size

        <f1crazed@gmail .com> wrote in message
        news:1115066228 .059843.72590@f 14g2000cwb.goog legroups.com...[color=blue]
        > Hello
        >
        > I have a table that I am trying to get the size of:
        >
        > document.getEle mentById("tblma in").height
        >
        > But if I don't set the height of the table, the statment above returns
        > nothing. I have text that is dynamicaly created and I want to know
        > the
        > height of the table once the text has been entered in the table.[/color]

        <body onload="alert(d ocument.getElem entById('tblmai n').offsetHeigh t);">
        <table id="tblmain"><t r><td>THIS IS A TEST</td></tr></table>

        Seems to work in IE 6.0.2900 (other versions untested), Firefox 1.0.3
        (other versions untested), Mozilla 1.0.2 and 1.7.7 (other versions
        untested), Opera 7.54 and 8.0 (other versions untested) - all under
        Windows.

        It gives slightly different results for the Gecko-based browsers.

        --
        Grant Wagner <gwagner@agrico reunited.com>
        comp.lang.javas cript FAQ - http://jibbering.com/faq


        Comment

        Working...