Expanding table help

Discussion in 'HTML' started by Menolo, Feb 5, 2005.

  1. Menolo

    Menolo Guest

    This works kind of ok in IE but does not restore correct in
    Netscape/Firefox, please let me know how I can fix or is there a better way,
    I would also like to incorporate a '+' and '-' image for expand and restore.
    Thanks
    http://www.kerryhotrod.com/test/expand.htm
    Menolo, Feb 5, 2005
    #1
    1. Advertising

  2. Menolo

    Steve Pugh Guest

    "Menolo" <> wrote:

    >This works kind of ok in IE but does not restore correct in
    >Netscape/Firefox, please let me know how I can fix or is there a better way,
    >I would also like to incorporate a '+' and '-' image for expand and restore.
    >Thanks
    >http://www.kerryhotrod.com/test/expand.htm


    Netscape and Firefox know that table rows are not display: block and
    hence making them display: block will not restore their default
    presentation.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Feb 5, 2005
    #2
    1. Advertising

  3. Menolo

    Toby Inkster Guest

    Toby Inkster, Feb 5, 2005
    #3
  4. Menolo

    Menolo Guest

    Thx for reply, that works and restores as I want in NN/Firefox now but will
    not work in IE at all.

    "Toby Inkster" <> wrote in message
    news:p...
    > Menolo wrote:
    >
    >> http://www.kerryhotrod.com/test/expand.htm

    >
    > Setting "display:block" for table rows is nonsense. You should set
    > "display:table-row".
    >
    > --
    > Toby A Inkster BSc (Hons) ARCS
    > Contact Me ~ http://tobyinkster.co.uk/contact
    >
    Menolo, Feb 7, 2005
    #4
  5. Menolo

    mscir Guest

    Menolo wrote:
    > Thx for reply, that works and restores as I want in NN/Firefox now but will
    > not work in IE at all.


    >>>http://www.kerryhotrod.com/test/expand.htm

    >>
    >>Setting "display:block" for table rows is nonsense. You should set
    >>"display:table-row".


    It works in my IE6, Netscape 7.2.

    Mike
    mscir, Feb 7, 2005
    #5
  6. Menolo

    Menolo Guest

    ok, please look and tell me where I am wrong.
    http://www.kerryhotrod.com/test/table-row.htm

    "mscir" <> wrote in message
    news:...
    > Menolo wrote:
    >> Thx for reply, that works and restores as I want in NN/Firefox now but
    >> will not work in IE at all.

    >
    >>>>http://www.kerryhotrod.com/test/expand.htm
    >>>
    >>>Setting "display:block" for table rows is nonsense. You should set
    >>>"display:table-row".

    >
    > It works in my IE6, Netscape 7.2.
    >
    > Mike
    Menolo, Feb 7, 2005
    #6
  7. Menolo

    rf Guest

    "Menolo" <> wrote

    > ok, please look and tell me where I am wrong.
    > http://www.kerryhotrod.com/test/table-row.htm


    You have errors. Turn on error reporting in IE.

    In any case we had almost exactly the same discussion a couple of months
    ago.

    IE does not understand table-row. If you specify this then it might barf.

    Best is to swap between display="none" and display="". The latter is the
    same as omitting the display: property. The browser will use whatever it
    sees fit to use as the default.
    rf, Feb 7, 2005
    #7
  8. Menolo

    mscir Guest

    rf wrote:

    > "Menolo" <> wrote
    >>ok, please look and tell me where I am wrong.
    >>http://www.kerryhotrod.com/test/table-row.htm

    > You have errors. Turn on error reporting in IE.


    How about this, including these changes:

    - use var x...
    - use inline
    - use href="#"


    <script type="text/javascript">
    function doTable(i){
    if(!document.getElementById)return;
    var d=document.getElementById(i);
    var t=d.getElementsByTagName("TR");
    for(var x=0;x<t.length;x++)
    if(t[x].className=='expand')
    t[x].style.display=(t[x].style.display=='none')?'inline':'none';
    }
    </script>
    </head>
    <body onLoad="doTable('table1'); return false;">

    <a href="#" onclick="doTable('table1'); return
    false;">Expand/contract</a></td>
    mscir, Feb 8, 2005
    #8
  9. Menolo

    rf Guest

    "mscir" <> wrote
    >
    > How about this, including these changes:


    Why are you asking me? I'm not even vaguely interested in getting javascript
    hiding stuff working.

    > t[x].style.display=(t[x].style.display=='none')?'inline':'none';


    That is even more bizarre than the original problem.

    Who knows *what* a browser would do with a <tr> with display: inline :)
    rf, Feb 8, 2005
    #9
  10. Menolo

    Menolo Guest

    Thanks for the help.
    Menolo, Feb 8, 2005
    #10
    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. Dmitri Zakharov
    Replies:
    2
    Views:
    6,501
    Dmitry Roslyakov
    Jun 11, 2004
  2. jimmycrack

    Expanding Table, then resizes... HTML / PHP

    jimmycrack, Aug 30, 2010, in forum: HTML and CSS
    Replies:
    0
    Views:
    499
    jimmycrack
    Aug 30, 2010
  3. Ivan Debono

    Expanding a table's row height

    Ivan Debono, Oct 19, 2004, in forum: ASP General
    Replies:
    1
    Views:
    197
    Aaron [SQL Server MVP]
    Oct 19, 2004
  4. Replies:
    7
    Views:
    181
    Xicheng Jia
    May 3, 2007
  5. Greg
    Replies:
    2
    Views:
    112
Loading...

Share This Page