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

P

Paul Thompson

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

Evertjan.

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
 
K

kaeli

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

Paul Thompson

kaeli said:
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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,082
Messages
2,570,588
Members
47,210
Latest member
JuliaMulli

Latest Threads

Top