In ancient days, people used tables for layout because it was the only thing that worked, but tables were never designed for layout and, now that there are better ways, using tables for layout is stupid (see article titled that under Howtos at the top of this page).
A <div> element is one used to provide structure to a page and group common elements together. It is never an automatic decision to use one anywhere unless it's necessary. Some pages can contain none at all.
Laying out a web page is done with CSS and the normal flow of all html elements on a page. The question of which to use, tables or divs, is not one worth asking.
Think you need HTML tables to craft complex liquid layouts? Not so! In this tip-packed tutorial, Mark Newhouse shares advanced yet practical CSS techniques any working web designer can use.
From what I have read, you cannot replace tables with CSS? I use both on my site, and I have tried to get the same control over the placement of information (and backgrounds) using CSS instead of tables, but due to lack of experience I can't just yet.
I guess what I am asking is: Can I do the same with CSS as I can with tables, and will it be better?
What you have to do is quit thinking in "tables mode". That's what I find most people trying to do is get CSS to act like a table when a table isn't necessary in the first place.
Anything tables can do with layout, CSS can do better.
To get something like rounded borders, you need something like tables, <div>'s or even <p>'s I think. But this is really just replacing <td>'s with <div>'s? Really, the rest it fine, I think CSS is definately better with elastic and fluid page designs, I am only struggling with the look of my content borders.
Tables are just pre-laid out grids you are confined to. divs are not. You don't have to use the borders that come with CSS. You can create your own with an image editor like Photoshop and use it as a background image or place them along the edges.
Tables are just pre-laid out grids you are confined to. divs are not. You don't have to use the borders that come with CSS. You can create your own with an image editor like Photoshop and use it as a background image or place them along the edges.
I do use photoshop, but to make table backgrounds. I thought CSS only allowed you to change the top, bottom, left and right border? If this is true, then you can't really do customised corners? Or can you?
I do use photoshop, but to make table backgrounds. I thought CSS only allowed you to change the top, bottom, left and right border? If this is true, then you can't really do customised corners? Or can you?
Comment