On 15 Feb 15:01, Mark Rogers wrote:
On 15/02/10 14:53, Steve Fosdick wrote:
I've seem recommendations elsewhere not to use tables a layout tool but only for real tables of data because using them for layout is reputed to confuse screen readers.
We were debating this in the office today (without satisfactory conclusions).
A fairly typical website design has a header, a footer, and the bit between the two split vertically to give a menu on the left and content on the right.
Is there a way in CSS to do this simply so that the layout is adhered to regardless of the content of the four "panes"? With tables this is trivial, but every CSS design I've seen seems to work fine until (eg) the content pane has enough content in it to reach the bottom of the left hand menu, then it wraps below the menu, or all the content drops below the menu, or something else weird happens.
Usual method round that is to float menu to left, content to right, wrap them in a containing div, and have one more div in there that is basically just a clear: both; so that the footer kicks in in the right place (though, you can just make that div the footer and have done with it :)
So you end up with a div layout like: +---------------------------+ | HEADER | +---------------------------+ |+----++-------------------+| ||MENU||CONTENT || || || || || || || |+----+| || | | || | +-------------------+| |+-------------------------+| || FOOTER || |+-------------------------+| +---------------------------+
(Yeah - OK - I know my ASCII art skills suck, but that should give a reasonable idea.)
I think part of the problem is that with CSS it seems quite easy to apply a style to some of the content that breaks the page layout in ways that would be impossible when it is constrained inside a table cell.
Well, you can transcribe a div layout in to a table layout *IF* you forget about interwebnets exploder, as the css spec allows you to do that with the display attribute (IIRC).
Damn I've been in this business too long ;)