Results 1 to 4 of 4
  1. #1
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Dynamic tables in classic ASP page

    <P ID="edit" class=small>(Edited by jscher2000 on 29-Jul-04 23:59. )</P>The following post from last week describes the problem I'm having with my current approach. I have been marching through a recordset laying out a table with selected hidden rows, and provides imagemap buttons to let the user selectively hide and display rows. Question: what would be a better way to dynamically generate tables without a round-trip to the server? No quickie hacks have solved the problem, so I'm fairly certain that I need some fresh ideas. I can plop the data into some kind of data structure in the script declaration, but it's a LOT of data. I need a better plan. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    <center>
    <img src=/w3timages/blackline.gif width=33% height=2> Earlier Post <img src=/w3timages/blackline.gif width=33% height=2></center>

    I try to write cross-platform code, but this one has me stumped. I have a page that contains hidden table rows. The detail can be revealed by clicking a tab, which runs a script that change the STYLE="display: none" attribute of that row to STYLE="display: block". This works swell in IE, but completely chokes in FireFox. It appears that having the display property in the STYLE attribute for the row blows away the normal HTML behavior, which is for cells in a column to have the same width as those defined for the first row. In fact, even if I copy all of the WIDTH attributes to the cells in that row, FireFox collapses them in the manner illustrated in the attached. Maybe this is just a bug and I should ignore it, but if this is how HTML is supposed to work, I need a new approach.

    This technique of using the display selector to show and hide rows saves me a round trip to the server to obtain more detail (or to calculate more aggregated data), so it helps reduce stress on the server. This is important. On the other hand, I need a presentable page. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> And I might be just a little bit too lazy to learn XML to do this the "right" way.

    Any thoughts??
    Attached Images Attached Images

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dynamic tables in classic ASP page

    This may be out of the question, depending on the browsers and versions you're targeting. Have you tried the Visiblility style?

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Dynamic tables in classic ASP page

    The goods news is, it preserved the cell widths!! The bad news is, "collapse" doesn't actually collapse out the white space!! That is the problem mentioned in my old HTML/CSS book, but I was hoping that the new "collapse" value worked around that. Not in Firefox, unfortunately.

    I wonder whether Firefox supports "xml data islands." There must be a way to do this.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Dynamic tables in classic ASP page

    I found the answer to my original question, thus bypassing all sorts of extremely complicated data stuff.

    According to CSS2 (Chapter 17), the correct display type for a table row is table-row and not block. It seems tautological, but making this tiny change in my JavaScript makes Firefox very happy. However, IE6 does not recognize table-row as a valid display value, and throws up a script error. <heavy sigh> At least I know what I have to do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •