The good reasons for nesting TABLE elements are ZERO! - Unless you mean Laziness.
The bad reasons for doing so are very common there are a variety of concerns it slows the browser; it detrimentally affects layout, causes bloat, is less powerful than CSS, etc…
Last edited by Robert Wellock; 11-21-2005 at 11:10 AM.
Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
As you all know, I really hate to be a contrarian here but one real reason for nesting tables would be to mark up some hierarchical data structure like a list of purchase orders, each with their list of line items.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
As you all know, I really hate to be a contrarian here but one real reason for nesting tables would be to mark up some hierarchical data structure like a list of purchase orders, each with their list of line items.
I don't know. A table in a table? I've never seen anything like that in print. It's just too jumbled. Maybe a list of tables, but never a table of tables.
ray hit the point I was going to make. There is legitimate table data which can be very beneficial to use nested tables.
If you are using them to provide layout structure to your site, bad idea. If you have information which is best conveyed in a multiple-table format then do so.
I don't know. A table in a table? I've never seen anything like that in print. It's just too jumbled. Maybe a list of tables, but never a table of tables.
Where you have a table surrounding tables of data. This is a basic nesting situation (this one would be better suited to using lists as well, I believe), but there are deeper levels of heirarchy where the nesting comes in handy.
Where you have a table surrounding tables of data. This is a basic nesting situation (this one would be better suited to using lists as well, I believe), but there are deeper levels of heirarchy where the nesting comes in handy.
Well, of course your demonstration was just that of a basic, non-nested table, so I'm a little confused. I'm not trying to be stubborn here, but I really can't think of a situation where having nested data tables would be beneficially or neccessary. (Because as we all know here, our tables should only be data tables).
Well, of course your demonstration was just that of a basic, non-nested table, so I'm a little confused. I'm not trying to be stubborn here, but I really can't think of a situation where having nested data tables would be beneficially or neccessary. (Because as we all know here, our tables should only be data tables).
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Ahh, I see. But given that example, why not just use multiple <tbody> ?
Multiple reasons, the best one I can think of is that still doesn't quite get the strict arrangement necessary for someone who might want to deliberately delineate sets of data with borders and padding in ways that the tbody thead tfoot tags won't allow you to do.
I've never personally used a tbody, but from the looks of it I can imagine that if I were to be writing an invoice for download (in HTML format? I don't know why) the tbody would not work for me.
If you've ever used a TABLE in HTML 4.01 then you've used a TBODY. It's there with or without the tags.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Bookmarks