If you aren't using CSS positioning, why not?
Thursday April 13, 2006
Tables are passé, they're boring. If you're still using tables for page layout then you're behind the times for Web development. Luckily it's easy to use CSS to position the elements on your Web pages as precisely as you could wish.
Poll: Do you use CSS positioning?
- Yes, for every page I write.
- Yes, most of the time.
- Yes, on less important pages.
- No, I don't know how.
- No, I don't like CSS positioning.
- No, I left my reason in a comment.


Comments
Hey, I read your stuff all the time. Is this comment functionality new? Anyways, you didn’t exactly give a complete lesson on CSS positioning, and I think it might have been a good idea to give a link to a good page where you can learn more about this.
I do my layouts with CSS all the time, it’s alot easier to make quick fixes by editing the one CSS file, rather go through each page editing numbers.
Oh and: Inline styles, YUCKY
Using an external stylesheet not only requires a lot less code than using tables but you also get to use more flexible layouts than the grid format enforced by tables and can change the layout of all of the pages on your site in one go instead of having to edit each page individually (with the resultant typos in several of them).
Tables ARE positioning elements!! Get over it. Table layouts are as old as writing but typewriters are really where we see the TAB key being used to line up information for display purposes.
Tables are robust where CSS layouts often are not and by the time you have added in the masses of CSS work arounds to make all browsers work some of the time, table layouts can often end up with smaller downloads.
Let me say it again - tables ARE layout structures.
Tables are NOT positioning elements in the general term. They are there to sort TABular data.
I don’t - for the life of me - understand why people refuse to sit down and learn CSS. You can do so much more with a stylesheet (in every sense of the word “more”) than you can without it. And all the font tags required for non-stylesheet sites WILL result in larger file sizes.
How can you say that
(table width=”50%” border=”2″ cellspacing=”3″ cellpadding=”0″ bordercolor=”#cc0000″)
(td)
(tr)
content
(/tr)
(/td)
(/table)
time and time again in an HTML document will result in a smaller file size than
(div id=”content”)
content
(/div)
?????
Anyone using tables in lieu of CSS is jaded, if not lazy.
CSS is so much easier to work with than tables. However, if someone wants to use tables for their layout, they should be able to do it. Eventually, they will be left out of the industry. It is like plowing with a mule. It works and they are used to it so, don’t rock their boat!
I’ve tried to use CSS positioning and I’ve gone through a few tutorials. Most of every tutorial I’ve tried is composed of how to do work arounds for browsers that don’t properly implement CSS positioning. A great many pages that I’ve seen that use CSS positioning have text written over the top of other text, especially near the bottom of the page.
Maybe you should run another series on CSS positioning and address those kinds of problems. Maybe, then, one could see how CSS positioning for layouts does a better job that old reliable tables.
I’m not a professional web designer. I’m just an amateur that works with a few web sites. Most everything I know about HTML, CSS, etc., I learned on the web from you. Thank you for all your help!
The one thing that I would love to see is how to use CSS to centre a page. With tables, it is easy and works on all browsers: create a table 100% wide and then centre another fixed width table inside. I have yet to see a way of doing this in CSS that works on all browsers.
Tables, still often good for doing an overall page breakdown, but I use PHP includes and CSS with it. Without those tables would give me no joy at all.
I would love to see the day all the browsers worked the same though.