I've read a few times now that being are abusing tables... eg. 'There is
nothing on that page that requires tables - use CSS instead..."
Now some questions...
1) Why use CSS over tables for layout?
2) How would I create a few seperate columns on the same page without using
tables and just CSS??
Thanks
Domestos
> 1) Why use CSS over tables for layout?
Several reasons:
1. Layout is a presentation matter. HTML (and thus the <table> tag!) is
designed for marking up a document's structure -- not for specifying how
it looks.
2. Tables can introduce accessibility problems (although these are often
overstated!)
3. If tables were always used strictly for marking up tabular data, we
would now have some pretty nifty spreadsheet-like features in browsers --
sort alphabetically by table column, automatic totals of numeric cell
ranges, click on a table cell to highlight the appropriate row and column
headers, etc. I want these features. So everybody! only use tables for
marking up tabular data!
4. As with all things CSS, it is useful to have all your styling in one
place so if you want to, say, move your navigation bar from the right to
the left, you don't need to edit 100 different HTML files: just one CSS
file.
> 2) How would I create a few seperate columns on the same page without using
> tables and just CSS??
Depends on many things. How many columns? Do you want them to be equal
lengths? Different lengths?
Some examples:
http://www.goddamn.co.uk/tobyink/Documents/html_tutorial/css-twocolumn.html
http://glish.com/css/
--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
>> 1) Why use CSS over tables for layout?
> Several reasons:
5) User agents can cache style sheets, and pages using style sheets for
layout are (in my experience) always smaller then the equivalent table
abuse. This means faster loading pages, and cheaper bandwidth bills.
6) Different style sheets can be provided for different media types
automatically. A page can look great on screen, and great on paper without
the visitor having to follow a link to another page. Then you can have
another style sheet for handhelds so narrow displays get the benefit of a
single column version of a design.
7) As the HTML is simpler, it is easier to read and write.
--
David Dorward http://dorward.me.uk/