A while back, on 12 May 2011 15:17, Greg Thomas Greg@thethomashome.co.uk wrote:
On 12 May 2011 15:04, Mark Rogers mark@quarella.co.uk wrote:
> Why don't we just have > <layout><lr><ld></ld></lr></layout> (functionally equivalent to table/tr/td > but providing the distinction for all the valid reasons that table is bad > for layout)?
Well, it's still the same problem you have with tables; HTML is supposed to be all about content, but you're describing layout.
OK, coming back to this, is there anything "wrong" with the following layout? You will recall that my original question was:
How to I convert the following table code to CSS (on the grounds that tables are bad): <table> <tr><th colspan=2>Heading</th></tr> <tr><td>Menu</td><td>Content</td></tr> <tr><td colspan=2>Footer</td></tr> </table>
So, given that I want table-styled layout but shouldn't use table tags to describe the layout, and the following seems to work, is it "acceptable" to the purists? The HTML seems to be pure content now, and the CSS contains all the layout information, so it seems like it should be OK but it seems too easy?
<html> <head> <style><!-- #header, #main, #footer { display:table; margin:0px 2%; width:96%; } #menu, #content { display:table-cell; } #header { background-color: #fcc; border-bottom: solid 1px black; } #footer { background-color: #cfc; border-top: solid 1px black; } #menu { border-right: solid 1px black; width: 30%; background-color: #eee; } #content { background-color: #ccc; } --></style> </head> <body> <div id="header">Header</div> <div id="main"> <div id="menu"> Menu </div> <div id="content"> Content<br/>over<br/>several<br/>lines </div> </div> <div id="footer">Footer</div> </body> </html>