Can somebody tell me whether div inside a table is allowed or not according to w3c
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
While you can, as others have noted here, put a DIV inside a TD (not as a direct child of TABLE), I strongly advise against using a DIV as a child of a TD. Unless, of course, you're a fan of headaches.
There is little to be gained and a whole lot to be lost, as there are many cross-browser discrepancies regarding how widths, margins, borders, etc., are handled when you combine the two. I can't tell you how many times I've had to clean up that kind of markup for clients because they were having trouble getting their HTML to display correctly in this or that browser.
Then again, if you're not fussy about how things look, disregard this advice.
you can put div tags inside a td tag, but not directly inside a table or tr tag. examples:
this works:
this does not work:
nor does this work:
This document was successfully checked as XHTML 1.0 Transitional!
It is allow as TD can contain inline- AND block-elements.
Here you can find it in the reference: http://xhtml.com/en/xhtml/reference/td/#td-contains
You can't put a
div
directly inside atable
, like this:Putting a
div
inside atd
orth
element is fine, however: