Victor Bien wrote:
[color=blue]
> W3C says somewhere that tables should not be used for formatting
>columns etc. but that style sheets should be used instead.[/color]
I wouldn't see that as strict as it may sound. Of course, tables are
not meant for layout issues and one should avoid it whenever it's
possible. But in some cases it might be better to use one (one!)
simple table for layout instead of many floated or absolute positioned
elements, which may raise lots of problems in some (older) browsers
and (maybe) decrease the usability of the site.
On my pages I sometimes use the "best of both worlds" - one single
table with 2 or 3 cells for the main layout, CSS for all the rest.
Sometimes you just have to find a compromise between strictly
following the recommendations and usability.
[color=blue]
>Where are the
>documents that show you how to do this? The tutorial on the W3C site is
>too elementary for me.[/color]
Currently I have no links (at least not in English *g*), but I'm sure
Google knows lots of them.
[color=blue]
> The W3C validator page itself uses this recommended technique but I
>have no reference about much of the code it uses.[/color]
The official recommendation is the reference.
http://www.w3.org/TR/REC-CSS2/
[color=blue]
>For example:
>@import url (alpha import??)
>div.navbar {
> float: right;
> [...]
> margin: .1ex .1ex 2.5ex 1ex;
> [...]
>}
>(float?? ex??)
>
> This code properly places a navigation bar which I would have used a
>table to create. And so and so forth... ???[/color]
The navbar is positioned on the right of the surrounding element (body
in this case), the rest of the text floats around it.
9.5.1 Positioning the float: the 'float' property
http://www.w3.org/TR/REC-CSS2/visure...float-position
See the difference:
Using a table Using CSS and
____________ floated elements
| | | ____________
| text | nav | | | |
| text | | | text | nav |
| text | | | text |_____|
| text | | | text text |
| text | | | text text |
| text | | |____________|
|______|_____|
So using floating elements can save you a lot of space which would be
wasted with table layout.
And for the ex values have a look at
4.3.2 Lengths
http://www.w3.org/TR/REC-CSS2/syndata.html#length-units
HTH
Micha