inline table doesn't display changes

Discussion in 'Javascript' started by aleko, Apr 8, 2008.

  1. aleko

    aleko Guest

    Hi all,

    I am trying to update a span inside an inline table, and even though
    the DOM element is updated the table doesn't refresh - it goes blank.
    This happens only if Firefox, and it seems the problem is caused by
    the 'display:-moz-inline-box' style (see code at end). Does anyone
    know of a workaround for this?

    Thanks in advance,

    Aleko

    Paste, save, load into FF.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
    www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <style type="text/css">
    .tbl
    {
    border:1px solid black;
    display:-moz-inline-box; /* without this, everything is fine */
    }

    .browseBtn
    {
    background-color:#dedede;
    cursor:pointer;
    }
    </style>
    </head>
    <body>
    inline table:
    <table class="tbl" cellspacing="1" cellpadding="0">
    <tr>
    <td width="200px" class="tblLabel">
    <span id="label" name="label">Select...</span>
    </td>
    <td width="18px" class="browseBtn"
    onclick="document.getElementById('label').innerHTML = 'hello'; return
    false;">&nbsp;</span>
    </td>
    </tr>
    </table>
    </body>
    </html>
     
    aleko, Apr 8, 2008
    #1
    1. Advertising

  2. aleko wrote:

    > I am trying to update a span inside an inline table, and even though
    > the DOM element is updated the table doesn't refresh - it goes blank.
    > This happens only if Firefox, and it seems the problem is caused by
    > the 'display:-moz-inline-box' style (see code at end). Does anyone
    > know of a workaround for this?


    I have tried other ways like setting textContent or like setting
    firstChild.nodeValue but the span goes blank nevertheless so I don't
    know of a workaround.
    The code works fine with a Firefox 3.0 nightly so it seems there is a
    bug in Firefox 2.0 that has been fixed for 3.0.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Apr 8, 2008
    #2
    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. Abhi
    Replies:
    2
    Views:
    752
    E. Robert Tisdale
    Jul 3, 2003
  2. Alvin
    Replies:
    7
    Views:
    489
    E. Robert Tisdale
    May 6, 2005
  3. Replies:
    3
    Views:
    473
  4. Daniel Vallstrom
    Replies:
    2
    Views:
    1,960
    Kevin Bracey
    Nov 21, 2003
  5. Evertjan.
    Replies:
    6
    Views:
    137
    Evertjan.
    Apr 9, 2009
Loading...

Share This Page