width:500px; /* width of your centered div*/
margin:0px auto;
Tables are still the most reliable way to do page layout, less faffing around than with CSS.
oh, and avoid the CSS layout purists, CSS layout is not worth the pain.
1. Because using tables for presentation and layout stops the content from having a natural hierarchy in its purest form, as all language-based content should have [from headings and sub-headings down to paragraphs];Since people are already discussing it - I've always been an advocate of using CSS rather than tables. Truth of the matter is, I have no idea why. Mostly just because it's the 'standard.' I mean CSS involves using so many hacks it's unreal... Can anyone shed any light on this issue for me?
The guy is just starting out.
Yes, I still use tables for layout but my background layout is always incredibly simple (1 table, 2 columns). This means that my web pages always display correctly in every browser I have ever used, and I never have to spend any time tweaking divs, using special corrections, or generally pulling my hair out.
Each to their own, but this works for me and is definitely my advice for newbies. I am an advocate of very simple design and appreciate that others may like to do things differently.
I do use CSS for formatting however.
Rgds
1. Because using tables for presentation and layout stops the content from having a natural hierarchy in its purest form, as all language-based content should have [from headings and sub-headings down to paragraphs];
2. Table-based layout code is mixed in with the content code, making content more difficult to maintain manually;
3. Spiders for search engines can't differentiate between layout code and content code, effectively diluting the 'appeal' or relevancy to searches. As far as I'm aware, most spiders only look at a certain number of lines of a site's page's code. The more of those lines that are taken up by layout code and not content code, the poorer the site's results in searches.
4. Site-wide changes to style and layout can be implemented much more easily with CSS; table-based layouts require considerably more time and effort, as a rule.