467,915 Members | 1,150 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

<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?

Jul 20 '05 #1
  • viewed: 82820
Share:
3 Replies
Paul Thompson wrote on 28 aug 2003 in comp.lang.javascript:
When I put a <div ...> inside a <table> specification, functionality is
not there. When I put the <table> inside the <div> everything works.


1 not true

2 not javascript, better ask a html NG

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
In article <bi**********@newsreader.wustl.edu>, pa**@wubios.wustl.edu
enlightened us with...
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?


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?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #3


kaeli wrote:
In article <bi**********@newsreader.wustl.edu>, pa**@wubios.wustl.edu
enlightened us with...
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?

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?


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...

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
-------------------------------------------------


Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by F. Da Costa | last post: by
19 posts views Thread by CMAR | last post: by
2 posts views Thread by bissatch | last post: by
2 posts views Thread by taras.di | last post: by
15 posts views Thread by scott | last post: by
13 posts views Thread by wilq | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.