<div > inside <table> doesn't work - why not?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Thompson

    <div > inside <table> doesn't work - why not?

    When I put a <div ...> inside a <table> specification, functionality is
    not there. When I put the <table> inside the <div> everything works.

    Why is that?

  • Evertjan.

    #2
    Re: &lt;div &gt; inside &lt;table&gt ; doesn't work - why not?

    Paul Thompson wrote on 28 aug 2003 in comp.lang.javas cript:
    [color=blue]
    > When I put a <div ...> inside a <table> specification, functionality is
    > not there. When I put the <table> inside the <div> everything works.[/color]

    1 not true

    2 not javascript, better ask a html NG



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • kaeli

      #3
      Re: &lt;div &gt; inside &lt;table&gt ; doesn't work - why not?

      In article <bil4hk$2pn$1@n ewsreader.wustl .edu>, paul@wubios.wus tl.edu
      enlightened us with...[color=blue]
      > When I put a <div ...> inside a <table> specification, functionality is
      > not there. When I put the <table> inside the <div> everything works.
      >
      > Why is that?
      >
      >[/color]

      Because the magic 8 ball said so.

      How about a little more data for those of us with no magic 8 ball?

      I put divs in tables all the time and have no problem.
      Browser?
      What functionality doesn't work?
      What happens?
      What doesn't happen?
      Test code?


      You can't overlap. Watch your nesting.

      Bad:
      <div>
      <table>
      ....
      </div>
      </table>

      Bad:
      <table>
      ....
      <div>
      ....
      </table>
      </div>

      Bad:
      <table>
      <div>
      <tr>
      ....
      </tr>
      </div>
      </table>

      Good:
      <table>
      <tr><td>
      <div>
      ....
      </div>
      </td>
      </tr>
      </table>

      Divs in tables must be *in* the table cell, not between rows or cells.

      -------------------------------------------------
      ~kaeli~
      Press any key to continue or any other key to quit.
      Who is General Failure and why is he reading
      my hard disk?


      -------------------------------------------------

      Comment

      • Paul Thompson

        #4
        Re: &lt;div &gt; inside &lt;table&gt ; doesn't work - why not?



        kaeli wrote:[color=blue]
        > In article <bil4hk$2pn$1@n ewsreader.wustl .edu>, paul@wubios.wus tl.edu
        > enlightened us with...
        >[color=green]
        >>When I put a <div ...> inside a <table> specification, functionality is
        >>not there. When I put the <table> inside the <div> everything works.
        >>
        >>Why is that?
        >>
        >>[/color]
        >
        >
        > Because the magic 8 ball said so.
        >
        > How about a little more data for those of us with no magic 8 ball?
        >
        > I put divs in tables all the time and have no problem.
        > Browser?
        > What functionality doesn't work?
        > What happens?
        > What doesn't happen?
        > Test code?
        >
        >[/color]

        Thanks. Your reply addresses my problem. I was trying

        <table>
        <div>
        <tr><td>...
        </div><div>
        <tr><td>
        </div>
        </table>

        and this did not work at all. The problem appears to be that
        information must be properly presented within the table structure.
        I was trying to put the <div> between cells, which appears to be a
        non-starter.

        Appreciate your response...

        [color=blue]
        > You can't overlap. Watch your nesting.
        >
        > Bad:
        > <div>
        > <table>
        > ...
        > </div>
        > </table>
        >
        > Bad:
        > <table>
        > ...
        > <div>
        > ...
        > </table>
        > </div>
        >
        > Bad:
        > <table>
        > <div>
        > <tr>
        > ...
        > </tr>
        > </div>
        > </table>
        >
        > Good:
        > <table>
        > <tr><td>
        > <div>
        > ...
        > </div>
        > </td>
        > </tr>
        > </table>
        >
        > Divs in tables must be *in* the table cell, not between rows or cells.
        >
        > -------------------------------------------------
        > ~kaeli~
        > Press any key to continue or any other key to quit.
        > Who is General Failure and why is he reading
        > my hard disk?
        > http://www.ipwebdesign.net/wildAtHeart
        > http://www.ipwebdesign.net/kaelisSpace
        > -------------------------------------------------[/color]

        Comment

        Working...