Why doesn't FireFox expand or contract tables?

Discussion in 'HTML' started by Andrew Bailey, Apr 14, 2008.

  1. Hi,

    I thought this would be a simple problem to solve but 8 hours of Googling
    and trying various suggestions hasn't yielded any working solutions so I'd
    like to ask this group.

    I have a table with two cells, within each of these cells there is a table
    with a single cell. When the content of one inner cell expands it should
    force the other table to expand.

    It works fine in IE7 but fails in Firefox.

    Here's a code snippet (see source of example url for a more complete
    version)...


    <table width="100%" height="260">
    <td width="*" height="100%" valign="top">

    <table width="100%" height="260">
    <td valign="top">

    When this content is expanded...

    </td>
    </table>

    </td>
    <td width="150" height="100%" valign="top">

    <table width="100%" height="100%">
    <td valign="top">

    This table should expand too.

    </td>
    </table>

    </td>
    </table>


    Here is a link to a test example...

    http://www.microbuild.com/microbuild/test/expanding_table.html


    THE QUESTION:

    How can I make the blue table (see example url) expand and contract when the
    content of the green table is expanded or contracted in Firefox?



    Many thanks

    Andy
     
    Andrew Bailey, Apr 14, 2008
    #1
    1. Advertising

  2. Andrew Bailey wrote:
    > Hi,
    >
    > I thought this would be a simple problem to solve but 8 hours of
    > Googling and trying various suggestions hasn't yielded any working
    > solutions so I'd like to ask this group.
    >
    > I have a table with two cells, within each of these cells there is a
    > table with a single cell. When the content of one inner cell expands it
    > should force the other table to expand.
    >
    > It works fine in IE7 but fails in Firefox.


    Have you tried using CSS instead of the long-since outmoded practice of
    using height and width attributes in HTML to control the dimensions of
    elements?
     
    Harlan Messinger, Apr 14, 2008
    #2
    1. Advertising

  3. On Mon, 14 Apr 2008 19:16:04 +0000, Andrew Bailey wrote:

    > Hi,
    >
    > I thought this would be a simple problem to solve but 8 hours of
    > Googling and trying various suggestions hasn't yielded any working
    > solutions so I'd like to ask this group.
    >
    > I have a table with two cells, within each of these cells there is a
    > table with a single cell. When the content of one inner cell expands it
    > should force the other table to expand.
    >
    > It works fine in IE7 but fails in Firefox.


    [table snipped]


    > THE QUESTION:
    >
    > How can I make the blue table (see example url) expand and contract when
    > the content of the green table is expanded or contracted in Firefox?



    GranParadiso/3.0a8 (Firefox 3.0 beta) works like you desire.

    A few moments in Fx 2.5 didn't yield any quick fixes.


    That said, nesting tables is rarely (if ever) a good idea. If you are
    trying to do this for layout purposes, nested DIVS will give you a much
    better layout that is also more accessible.
     
    Jeremy J Starcher, Apr 14, 2008
    #3
  4. Andrew Bailey

    Els Guest

    Andrew Bailey wrote:

    > <table width="100%" height="260">


    > http://www.microbuild.com/microbuild/test/expanding_table.html


    > How can I make the blue table (see example url) expand and contract when the
    > content of the green table is expanded or contracted in Firefox?


    Not tested, but I think if you take the 260 height off both the other
    tables, your problem will be non-existent. The 100% height on the
    table with the blue border is 100% of the height that is *set* on the
    parent, which is 260px. Do you for any reason need the 260px height?


    --
    Els http://locusmeus.com/
     
    Els, Apr 14, 2008
    #4
  5. "Harlan Messinger" <> wrote in message
    news:...
    > Andrew Bailey wrote:
    >> Hi,
    >>
    >> I thought this would be a simple problem to solve but 8 hours of Googling
    >> and trying various suggestions hasn't yielded any working solutions so
    >> I'd like to ask this group.
    >>
    >> I have a table with two cells, within each of these cells there is a
    >> table with a single cell. When the content of one inner cell expands it
    >> should force the other table to expand.
    >>
    >> It works fine in IE7 but fails in Firefox.

    >
    > Have you tried using CSS instead of the long-since outmoded practice of
    > using height and width attributes in HTML to control the dimensions of
    > elements?


    Hi Harlan,

    I've added an identical example table to the url using css, but as you can
    see it behaves exactly the same as the original. I think it's one of those
    things where Firefox is probably obeying some standard to the letter even
    though it's dumb.

    Thanks for looking

    Andy
     
    Andrew Bailey, Apr 14, 2008
    #5
  6. "Els" <> wrote in message
    news:1vrmo8iytc41z.59vqpdqu1bp0$...
    > Andrew Bailey wrote:
    >
    >> <table width="100%" height="260">

    >
    >> http://www.microbuild.com/microbuild/test/expanding_table.html

    >
    >> How can I make the blue table (see example url) expand and contract when
    >> the
    >> content of the green table is expanded or contracted in Firefox?

    >
    > Not tested, but I think if you take the 260 height off both the other
    > tables, your problem will be non-existent. The 100% height on the
    > table with the blue border is 100% of the height that is *set* on the
    > parent, which is 260px. Do you for any reason need the 260px height?
    >
    >
    > --
    > Els http://locusmeus.com/


    Hi Els,

    I need the table to initially render to a height of 260, so yes that bit is
    deliberate.

    What I should then be able to do is specify 100% from that point on as 100%
    would equal 100% of 260 but once again I'm thwarted by Firefox (works fine
    in IE of course) as the green table will expand as expected (even though the
    blue won't) but then stays expanded and doesn't shrink.

    Thanks for looking


    Andy
     
    Andrew Bailey, Apr 14, 2008
    #6
  7. "Ben C" <> wrote in message
    news:...

    <snip>

    > You're asking for 100% height of an auto-height container.


    YEP... that's exactly what I want.


    > Firefox is well within the CSS spec to ignore the 100% and give you auto
    > instead.


    Seems like Firefox is too correct for it's own good if you ask me ;)


    So then, how do I achieve what should be very simple behavior in Firefox?



    Thanks for looking


    Andy
     
    Andrew Bailey, Apr 14, 2008
    #7
  8. WORK-AROUND FOUND

    "Andrew Bailey" <> wrote in message
    news:U3OMj.239$...
    > Hi,
    >
    > I thought this would be a simple problem to solve but 8 hours of Googling
    > and trying various suggestions hasn't yielded any working solutions so I'd
    > like to ask this group.
    >
    > I have a table with two cells, within each of these cells there is a table
    > with a single cell. When the content of one inner cell expands it should
    > force the other table to expand.
    >
    > It works fine in IE7 but fails in Firefox.
    >
    > Here's a code snippet (see source of example url for a more complete
    > version)...
    >
    >
    > <table width="100%" height="260">
    > <td width="*" height="100%" valign="top">
    >
    > <table width="100%" height="260">
    > <td valign="top">
    >
    > When this content is expanded...
    >
    > </td>
    > </table>
    >
    > </td>
    > <td width="150" height="100%" valign="top">
    >
    > <table width="100%" height="100%">
    > <td valign="top">
    >
    > This table should expand too.
    >
    > </td>
    > </table>
    >
    > </td>
    > </table>
    >
    >
    > Here is a link to a test example...
    >
    > http://www.microbuild.com/microbuild/test/expanding_table.html
    >
    >
    > THE QUESTION:
    >
    > How can I make the blue table (see example url) expand and contract when
    > the content of the green table is expanded or contracted in Firefox?
    >
    >
    >
    > Many thanks
    >
    > Andy
    >
    >
    >
    >


    Hi all,

    It would seem that the solution is to switch the entire table (or rather
    further up the mark-up tree). I have appended a third working example to the
    test url.

    Thanks for feedback and comments.

    Andy
     
    Andrew Bailey, Apr 14, 2008
    #8
  9. Andrew Bailey

    Bergamot Guest

    Andrew Bailey wrote:
    >
    > I have a table with two cells, within each of these cells there is a table
    > with a single cell. When the content of one inner cell expands it should
    > force the other table to expand.
    >
    > It works fine in IE7 but fails in Firefox.
    >
    > http://www.microbuild.com/microbuild/test/expanding_table.html


    Why do you need a nested table in that second cell? What happens if you
    get rid of that nested table and put the blue borders around that td
    instead?

    BTW, you should clean up that code. You have an invalid <style> element
    within the body. It belongs in the head section, plus it needs the
    required type attribute.

    Invalid code can be a cause of rendering issues in different browsers.
    Validated code eliminates code errors as a source of problems.

    --
    Berg
     
    Bergamot, Apr 15, 2008
    #9
  10. Andrew Bailey

    richard Guest

    On Mon, 14 Apr 2008 19:16:04 GMT, "Andrew Bailey"
    <> wrote:

    >Hi,
    >
    >I thought this would be a simple problem to solve but 8 hours of Googling
    >and trying various suggestions hasn't yielded any working solutions so I'd
    >like to ask this group.
    >
    >I have a table with two cells, within each of these cells there is a table
    >with a single cell. When the content of one inner cell expands it should
    >force the other table to expand.
    >
    >It works fine in IE7 but fails in Firefox.
    >
    >Here's a code snippet (see source of example url for a more complete
    >version)...
    >



    Two tables work independently of each other regardless of where they
    are placed. So expecting two adjoining rows to expand together is not
    gonna happen.
     
    richard, Apr 16, 2008
    #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. Wayfarer
    Replies:
    1
    Views:
    414
    David Dorward
    Oct 26, 2004
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    976
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,215
    Smokey Grindel
    Dec 2, 2006
  4. Specialist Verilog Engineers Roles
    Replies:
    0
    Views:
    488
    Specialist Verilog Engineers Roles
    Jun 27, 2007
  5. mt

    expand all, contract all

    mt, Oct 4, 2004, in forum: Javascript
    Replies:
    1
    Views:
    250
    Randy Webb
    Oct 4, 2004
Loading...

Share This Page