Click to See Complete Forum and Search --> : all css and no tables???


pulleys
04-05-2006, 08:54 PM
Just a quick question:

Would it be safe to use all CSS and absolutely no tables what so ever in respect to layout? For instance a simple menu could be constructed using a table to organize the menu items or use DIV tags for each menu item.

What are the postives and negatives of using only CSS?

Thanks

Jupac
04-05-2006, 10:39 PM
Yes it is better to use a full CSS layout with no Tables Why Tables are Stupid (http://www.hotdesign.com/seybold/)

ray326
04-05-2006, 11:16 PM
or use DIV tags for each menu itemActually, the standard way to do that is with a list. A menu is a list of links.

WebJoel
04-06-2006, 09:20 AM
for a 'simple menu' is to use unordered lists & <li>. It's cleaner, smaller, a lot easier to build and to style.

BrettNooyen
04-06-2006, 11:58 AM
It depends. Remember, tables are for tabular data. So if you plan on having lists of things, such as members in a database, don't be afraid to put that in a table.

But as far as the overall design/positioning, css is the way to go.

Don't ever let anyone tell you it's stupid to have a completely tableless website though, when you use them for what they're supposed to be used they are cleaner than the div jargon to get around it. Just use css to alter the table to your needs.

pulleys
04-06-2006, 12:24 PM
Thanks for the input everyone. I agree I think tables are great for data and css for most other things.

HoboBen
04-06-2006, 12:40 PM
Although, you can get a great CSS+DIVs driven site, spend 2-5 hours on it to make it look amazing and work fantastic...

Then open up Internet Explorer instead of firefox or netscape and...

Ooops, it's all hidious.

Unless you're careful, divs can really work badly on Internet Explorer. They hardly ever look the same on it as you may have planned with another browser.

I've also noticed IE takes div widths to be a "suggestion", and will add or subtract 10 pixels just because it feels like it.

For a few years still, the future of the web will be scared by Internet Explorer, so just a "heads up". Keep checking your site with Internet Explorer. It'll look great in firefox, but it may turn to gloop when faced with Microsoft software.

Good luck.

WebJoel
04-06-2006, 02:06 PM
....I've also noticed IE takes div widths to be a "suggestion", and will add or subtract 10 pixels just because it feels like it....

That isn't the fault of the DIV however. It's probably IE's annoying little box-model flaw. To correct this, always have this style in your page or external *css:

<style> {
border:0; padding:0; margin:0;
}
</style>

In it's absence, yes, there ARE one, two, ...five or six-some pixels that seem to come out of nowhere in IE in some instances... IE 'assumes' a value for the above three selectors. Declaring them to be "zero" re-sets IE to compliant.
:cool: