Problem getting HEIGHT property of a dynamic table!

Discussion in 'ASP .Net' started by Steve Bottoms, Mar 10, 2005.

  1. Hi, all! Using VB as code-behind in asp.net page...

    I have a TABLE control which I'm building dynamically. After the table is
    built, I'm trying to retrieve the HEIGHT property of that table
    (table.height.value) to be able to dynamically position the next elements on
    the form. However, this control property is coming back as -0- every time.
    I also try to get the table height with Javascript after-the-fact
    (table.style.height), but that returns a blank value.

    How can I get the height of the TABLE control AFTER building it, so I know
    where to place the next few elements in the flow??? Very frustrating for
    something that should be relatively simple...

    Thanks for any suggestions!
    Jack
    Steve Bottoms, Mar 10, 2005
    #1
    1. Advertising

  2. I think table.style.height is a client side property, so you cant detect it
    in server side code. Its also a really bad choice for layout as its so
    badly reprepsented in browesers that the use of it at best is typically
    flaky.

    Think about using panels and DIVs instead adn determine your positioning
    relative to the top left (0) of the browser window..

    < asp:panel id="Panel1" runat="server" style="POSITION: absolute;
    Left:910px; TOP:208px">
    < /asp:panel>

    --
    Regards

    John Timney
    ASP.NET MVP
    Microsoft Regional Director

    "Steve Bottoms" <> wrote in message
    news:%...
    > Hi, all! Using VB as code-behind in asp.net page...
    >
    > I have a TABLE control which I'm building dynamically. After the table is
    > built, I'm trying to retrieve the HEIGHT property of that table
    > (table.height.value) to be able to dynamically position the next elements

    on
    > the form. However, this control property is coming back as -0- every

    time.
    > I also try to get the table height with Javascript after-the-fact
    > (table.style.height), but that returns a blank value.
    >
    > How can I get the height of the TABLE control AFTER building it, so I know
    > where to place the next few elements in the flow??? Very frustrating for
    > something that should be relatively simple...
    >
    > Thanks for any suggestions!
    > Jack
    >
    >
    John Timney \(ASP.NET MVP\), Mar 10, 2005
    #2
    1. Advertising

  3. Well, here's the thing: I'm generating a variable number of sections
    (currently one row in a table) of variable length (some may be one word,
    some may be 1000 words). Each of these blocks (currently generated as
    multi-row tables) come one right after another. Using something like a
    region with a scroll bar isn't an option. I need to be able to "look" at a
    block (right now a table), get it's total on-screen height (which may be
    variable: nothing is fixed height), and use that to place the next block of
    text/items, which ALSO are variable. I can't use ANYTHING that's of fixed
    size, because that's just plain ugly. I'm finding it a bit hard to believe
    that this is so difficult.

    Does the size of a Panel (never used them except to display fixed-length
    text) grow based on the amount of content? Does the Panel have a height
    property that can be used to determine the positioning for the next element
    underneath it, or does it automatically grow, pushing later elements (Panels
    & Labels) further down? Can the Panel display HTML/DHTML (the text may have
    HTML; a quick test of a Panel doesn't render HTML)?

    This seems like such a simple thing, I can't believe it's not available in
    this day and age!! ;-)

    Jack




    "John Timney (ASP.NET MVP)" <> wrote in message
    news:...
    >I think table.style.height is a client side property, so you cant detect it
    > in server side code. Its also a really bad choice for layout as its so
    > badly reprepsented in browesers that the use of it at best is typically
    > flaky.
    >
    > Think about using panels and DIVs instead adn determine your positioning
    > relative to the top left (0) of the browser window..
    >
    > < asp:panel id="Panel1" runat="server" style="POSITION: absolute;
    > Left:910px; TOP:208px">
    > < /asp:panel>
    >
    > --
    > Regards
    >
    > John Timney
    > ASP.NET MVP
    > Microsoft Regional Director
    >
    > "Steve Bottoms" <> wrote in message
    > news:%...
    >> Hi, all! Using VB as code-behind in asp.net page...
    >>
    >> I have a TABLE control which I'm building dynamically. After the table
    >> is
    >> built, I'm trying to retrieve the HEIGHT property of that table
    >> (table.height.value) to be able to dynamically position the next elements

    > on
    >> the form. However, this control property is coming back as -0- every

    > time.
    >> I also try to get the table height with Javascript after-the-fact
    >> (table.style.height), but that returns a blank value.
    >>
    >> How can I get the height of the TABLE control AFTER building it, so I
    >> know
    >> where to place the next few elements in the flow??? Very frustrating for
    >> something that should be relatively simple...
    >>
    >> Thanks for any suggestions!
    >> Jack
    >>
    >>

    >
    >
    Steve Bottoms, Mar 10, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sebastiano

    height property of HTML table

    Sebastiano, Feb 11, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    542
    Shahar
    Feb 11, 2004
  2. hansiman

    row height in dynamic asp:table

    hansiman, Oct 2, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    6,135
    hansiman
    Oct 2, 2004
  3. EightNineThree

    Re: Table height property

    EightNineThree, Jul 7, 2003, in forum: HTML
    Replies:
    0
    Views:
    427
    EightNineThree
    Jul 7, 2003
  4. samer
    Replies:
    3
    Views:
    426
    Gregory A. Beamer
    Sep 28, 2009
  5. john T
    Replies:
    7
    Views:
    224
    Richard Formby
    Feb 19, 2004
Loading...

Share This Page