It seems like I heard/read somewhere that DIVs inside of TDs was a no-no. Not that it won't work, just something about them not being really compatible based on their display type. Can't find any evidence to back up my hunch, so I may be totally wrong.
No. Not necessarily.
If you need to place a DIV within a TD, be sure you're using the TD properly. If you don't care about tabular-data, and semantics, then you ultimately won't care about DIVs in TDs. I don't think there's a problem though - if you have to do it, you're fine.
What you probably heard was that tables are a no-no for layout, especially when tables are nested inside of tables. Divs are better for layout, for a number of reasons. But tables are perfectly OK for tabular data.
Haven't heard the Divs inside of Tables thing before, except that it implies that tables are being used for layout.
A table-cell can legitimately contain block-level elements so it's not, inherently, a faux-pas. Browser implentation, of course, leaves this a speculative-theoretical position. It may cause layout problems and bugs.
Though as tables were used for layout -and sometimes still are- I imagine that most browsers will render the content properly. Even IE.
It breaks semantics, that's all. It works fine, but there may be screen readers or something down the road that won't enjoy processing your HTML if you "break semantics".
To those people who would argue that tables should only be used for tabular data then it would be a no-no, but I have never had a problem with them.
After checking the XHTML DTD I discovered that a <TD>-element is allowed to contain block elements like headings, lists and also <DIV>-elements. Thus, using a <DIV>-element inside a <TD>-element does not violate the XHTML standard. I'm pretty sure that other moderne variations of HTML has an equivalent content model for the <TD>-element.
Using a div
instide a td
is not worse than any other way of using tables for layout. (Some people never use tables for layout, and I'm one of them.)
If you use a div
in a td
you will however get in a situation where it might be hard to predict how the elements will be sized. The default for a div is to determine it's width from it's parent, and the default for a table cell is to determine it's size depending on the size of it's content.
The rules for how a div
should be sized is well defined in the standards, but the rules for how a td
should be sized is not as well defined, so different browsers use slightly different algorithms.