Tables or CSS layout ?
Hi I have been playing with using both Tables and Css to layout my 3 column latest website. I have come across many websites that are along the same lines some very modern, some CMS based and some not so good. A hell of a lot of designers, templates and CMS's for this type of structure atleast are still using tables (to be clear thats inside an overall CSS structure) to create 3 column layouts, with the sizing and everything styled with CSS. How would other designers on here solve a problem like 3 columns. thanks Acknowledged
Public Comments
- The future is in CSS - although tables won't disappear altogether, they should be used for presenting tabular data. CSS layouts is the new standard. There will always be hacks, and ways to do things wrong (such as using tables). Using tables is lazy and wrong.
- Definitely go with CSS as it's more flexible. A common layout is to have a wrap div containing a header div, 3 column divs and a footer div like this (note I've left out colours, fonts, backgrounds...): body{text-align: center;} <!--this centers web page--> #wrap{margin: 0 auto; width: 900px; padding: 0px 0px 0px 0px; text-align: left; } #header {width: 900px;} #contentcol{display: inline; float: left; width: 560px; margin-left: 180px; } #leftcol{width: 160px; float: left; margin-left: -730px; } #rightcol{width: 100px; float: left; margin-left: 20px; margin-top: 10px; } #footer {clear: both;} This gives a 160px left col, 560px main col, and a 100px right col, all with 20px vert gutters. Note I've used a negative margin on leftcol so in your html you would have contentcol first (go for SEO) but it would be floated to the middle of the page with left col on its left. Hope this helps!
- I only use tables because their simple and backwards compatible. What i do is do the simple structure in HTML's table, then move onto the look and feel with CSS. I test my sites with all kinds of browsers to make sure they look and work the way i want them to. One of those is an very old version of opera which i use to test stuff with the eyes of windows 95 users ;P So in a nut shell, you gotta have both. Most of all, you got to find a good balance that works for all audience's.
- Whichever you are more comfortable with. At least with tables, people that use old browsers (by choice or necessity) can view your pages properly. Properly laid out tables is much better than poor CSS. If you have many pages that are laid out the same, then CSS may be a better choice although I've made table templates that work just as well too. I've ran into CSS snobs and their pages look horrible with some of the browsers I've used to view them.
Powered by Yahoo! Answers