473,574 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where Is It Written That I Should Use CSS Positioning?

This argument has come up two or three times lately.

We have a web standards document at our company that say "Use valid
HTML 4; We don't recommend switching to DIV-based CSS-P for layout
just yet though, tables are a lot easier."

That's because we have a lot of developers who aren't ready to move to
CSS-P and DIVs just yet.

But I'm being told our policies were contradictory. If we're going to
use standards, then we should use CSS positioning not TABLE code.

But we _are_ using standards! We're using valid HTML with a DOCTYPE
and everything. We don't use the FONT tag (though even _that_ is still
valid in Transitional HTML, did you notice?) and all the formatting,
all the backgrounds and colors and images and fonts are in the style
sheet, not in the page.

What, after all, is the real difference between

-------- ------------------------ --------
| TD | | TD | | TD |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
-------- ------------------------ --------

and

-------- ------------------------ --------
| DIV | | DIV | | DIV |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
-------- ------------------------ --------

anyway? The content comes in the same order in the page, and if I
include a "skip to content" link that takes people to the centre TD,
who have I hurt?

Tables should only be used for Tabular content, I hear you say --
well, isn't the traditional layout tabular, in a way? A column of nav,
a column of content, a column of whatever on the right. They're in
three different categories. Are tables really only to be used for
statistics on the consumption of cabbage in East Berlin from 1993 to
1994?

I forgot my original question -- oh yeah, where is it written,
actually literally where in the W3 website or the spec is it written
that I must use CSS-P now or my code isn't using standards?

Because the woman who I was arguing with eventually just said "well,
you're going against the SPIRIT of it" and I said "I don't have a
Spirit Validator, just an HTML Validator".

Joking aside, what document _should_ my opponent have pointed me to -
where is "Thou Shalt Use CSS-P" written, who decreed it - or is it
just a cultural assumption made by modern web developers, a sibboleth?
Jul 20 '05 #1
36 3369
Jack Hughes wrote:
This argument has come up two or three times lately.
Actually, in ciwah, it has come up far more than just two or three
times. Shame you didn't read those threads.
We have a web standards document at our company that say "Use valid
HTML 4;
That's suprising. Most companies are unaware of anything relating to
good authoring practices. May I ask which company this is?
We don't recommend switching to DIV-based CSS-P for layout just yet
though, tables are a lot easier."
I don't think tables are easier, but css positioning is not for the
faint of heart. Even if there were no bugs, it'd be hard, and there
are bugs, lots of them.
But I'm being told our policies were contradictory. If we're going
to use standards, then we should use CSS positioning not TABLE
code.
As of 2004, CSS is the proper tool for presentation of web documents.
HTML was never intended as a desktop publishing language. Efforts to
hammer it into one, especially via HTML 3.2, failed, leaving us with
transitional HTML for "legacy documents" and CSS for a more sensible
approach.
But we _are_ using standards! We're using valid HTML with a DOCTYPE
and everything.
Someone is confused. It's either you, or whoever told you this. An
HTML document is valid if and only if it conforms to the syntax of a
particular doc type definition. Since tables are part of several HTML
versions, any document which uses tables for any reason will validate.
What, after all, is the real difference between

-------- ------------------------ --------
| TD | | TD | | TD |
-------- ------------------------ --------
This markup claims there is tabular data in one row, and that each bit
of data is related to the other bits in some way. Therefore,
user-agents must present the data in such a way that the data makes
sense. In the ascii art example you provided, the ua has chosen a
logical presentation of a table, with the columns presented
side-by-side, as one might find in a book.
and

-------- ------------------------ --------
| DIV | | DIV | | DIV |
-------- ------------------------ --------
A div element should contain some division of content; beyond that,
div elements are semantically meaningless. Thus, the contents of a div
element are not necessarily related to the contents of another, even
where such div elements are presented, via CSS, side-by-side, as in
your second ascii art example.
The content comes in the same order in the page,
A table layout where the content "linearizes " is the less wrong way to
do things. Not abusing tables for layout is the right way to do things.
if I include a "skip to content" link that takes people to the
centre TD, who have I hurt?
Your mixing up several different issues. A "skip to content" link is
not related to table layouts, nor to validation.
Tables should only be used for Tabular content, I hear you say --
Does this mean you *did* read those other threads? If so, why did you
feel the need to start yet another go-round?
well, isn't the traditional layout tabular, in a way? A column of
nav, a column of content, a column of whatever on the right.
Who says that layout is traditional? What makes a layout traditional?
Perhaps you mean it is popular at the moment? That may be true, but it
is also subject to change.

In any case, it is not a table merely because it is laid out with some
bits next to other bits. A magazine article may have a sidebar with a
short, related article. The presentation of the sidebard is not a
table. It is layout where the related article is presented in a column
next to the main article. One might also choose to present the short,
related article at the bottom of the page, or on the next page. This
does not affect reader comprehension.

A table, by contrast, must be presented in some way that allows the
reader to make sense of the data. One cannot remove one column from a
table, move it to the next page, and expect readers to make sense of it.
Are tables really only to be used for statistics on the consumption
of cabbage in East Berlin from 1993 to 1994?
Of course not. They're also to be used for presenting sales of Lee
Perry cds in London; pollution levels in Mexico City; films produced
in India, France, and the U.S.; etc.
where is it written, actually literally where in the W3 website
or the spec is it written that I must use CSS-P now or my code
isn't using standards?
In the HTML 4 recommendation, of course.

http://www.w3.org/TR/html4/struct/tables.html

See the first section, "introducti on to tables."
the woman who I was arguing with eventually just said "well, you're
going against the SPIRIT of it"
Abusing tables for their presentation is a violation of HTML...
and I said "I don't have a Spirit Validator, just an HTML
Validator".


....but such abuse of tables does not violate the syntax of the
language. The best article I've read on this topic is from J. Korpela:

http://www.cs.tut.fi/~jkorpela/html/validation.html
B. Pearson will be along shortly to try his best to confuse you with a
rant about the so-called history of html.

Good luck.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2
"Jack Hughes" <ja********@yah oo.com> schrieb im Newsbeitrag
news:f4******** *************** **@posting.goog le.com...
This argument has come up two or three times lately.
[...]
I forgot my original question -- oh yeah, where is it written,
actually literally where in the W3 website or the spec is it written
that I must use CSS-P now or my code isn't using standards?


Äh - if you know the arguments, why do you ask again? You are free to use
whatever coding technique you feel comfortable with. You don't need the ok
of ciwah/ciwas regulars, do you?

This is neither about a "must" nor about religion, it is just essential to
know how things are intended to be by the people who developed them, and it
is great to know good arguments for and also against doing thins this or
that way. It just makes you free to decide which way you go and also it
gives you the ability to discuss this with your bosses, clients and
co-workers. So knowing about those issues makes you a professional. But it
is not necessary that you agree with all that is written here nor is it
necessary that anybody else agrees with your point of view.

--
Markus
Jul 20 '05 #3
ja********@yaho o.com (Jack Hughes) wrote in message news:<f4******* *************** ***@posting.goo gle.com>...
where is "Thou Shalt Use CSS-P" written


c.i.w.a.h

By a bunch of pinheads who only have the brains for one bandwagon, so
when they've jumped onto it, they can't accept any value in any other
way of doing it.

Understand what you're doing. Then make appropriate choices.

Blanket application of CSS everywhere is probably slightly better than
an equally consistent use of 1x1.gif, but neither is as good as doing
the right things, as circumstance demands.

Three column layout in CSS sucks, because float is dubious and so is
width or margin:auto. Go for the three column table, because it's
good, it's simple and it works. OTOH, a 5 column table because you
don't understand margins or padding isn't good.

If you work on authoring for mobile devices, you'll start to really
see benefits from dumping table-bloat.


We sometimes forget just how clued-up the readers of c.i.w.a.h are -
even the idiots. You'll be flamed hereabouts for the most trivial of
errors, yet out in the big world of corporate site building the level
of technical expertise and practice is still pitiful. I've got a
problem at the moment where I feed content form <corporate #1> to
<corporate #2> and they're cheefully stripping ampersand entities and
all sorts from the content, then wondering why I complain that it's no
longer valid HTML - "But it looks OK in my browser" they whine.
Jul 20 '05 #4

"Jack Hughes" <ja********@yah oo.com> wrote in message
news:f4******** *************** **@posting.goog le.com...

What, after all, is the real difference between

-------- ------------------------ --------
| TD | | TD | | TD |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
-------- ------------------------ --------

and

-------- ------------------------ --------
| DIV | | DIV | | DIV |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
-------- ------------------------ --------


Actually, the comparison is

<table>
<tr>
<td></td><td></td><td></td>
</tr>
</table>

and

<div></div><div></div><div></div>

And when you get down to it, I'm 100% positive that your table is much more
complicated than that whereas the <div> based layout is not.

Making The Business Case For Web Standards
http://www.karlcore.com/articles/article.php?id=23

Karl

Jul 20 '05 #5
Jack Hughes wrote:
This argument has come up two or three times lately. [snip] I forgot my original question -- oh yeah, where is it written,
actually literally where in the W3 website or the spec is it written
that I must use CSS-P now or my code isn't using standards? [snip] Joking aside, what document _should_ my opponent have pointed me to -
where is "Thou Shalt Use CSS-P" written, who decreed it - or is it
just a cultural assumption made by modern web developers, a sibboleth?


The short answer to your question is "nowhere important". I believe that the
objectives are getting forgotten.

When designing "infrastructure ", such as an operating system, or application
middleware, or the set of recommendations for the web, you had better design
it so that people using it can separate out lots of concerns. It is a good
idea to have a web where authors, and users, can handle different issues, in
different places, with different recommendations & technologies.

But that it not a requirement that those people actually *use* all those
different things in that way. That is up to them, or the people they are
answerable to. Or perhaps the law influences the decision.

The purpose of a web site is to communicate with the audience. The techniques
used must be evaluated against that purpose. Do layout tables hinder the
communication, perhaps because of the user's technology? Or do they help, by
enabling the author to build an effective site faster? Do layout tables make
the pages inefficient? Will they prevent important change needed for future
communication? These questions can be answered.

Experts should be able to assist with the analysis. A problem is that some
people opposed to layout tables appear to believe their own propaganda! Here
are some example:

"Layout tables make pages bloated & inefficient". Do the sums. They add
perhaps about 25 bytes per item being positioned. So, using them to achieve 3
columns may add about 75 bytes to the page. (*Bad* layout tables can be
dreadful! So can bad anything).

"Layout tables make your pages inaccessible". The Web Accessibility Initiative
came to a different conclusion in April 1999, and this is no longer a useful
assumption. (The key is whether they linearise well. In fact, the
linearisation of tableless pages is also important).

"Layout table freeze your layout as it is". I've seen it said that if you use
a layout table to put your site navigation on the right, you are stuck with it
on the right. But here is a page that uses a simple layout table to put the
site navigation table on the right:
http://www.childsupportanalysis.co.uk/
And here is that page, with the same table, and just 2 additional CSS rules
(embedded in the <head>). They put the site navigation on the left. No tricks,
no script, just valid HTML 4.01 Strict & CSS2:
http://www.childsupportanalysis.co.uk/reversed.htm

A better approach to this topic would be to be more objective, to help authors
answer their questions. If an author decides to go ahead with a layout table,
then how can the author use a good layout table, not a bad one? (You are
unlikely to be able to change the page layout significantly if you start with
a bad layout table).

It's only mark-up. It isn't sin!

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #6
Jack Hughes wrote:
This argument has come up two or three times lately.

We have a web standards document at our company that say "Use valid
HTML 4; We don't recommend switching to DIV-based CSS-P for layout
just yet though, tables are a lot easier."
If your content actually *is* a table, as in something you could caption as
"Table 1" in a book, then yes, keep it in a table. Otherwise, it's abuse of
table markup.
That's because we have a lot of developers who aren't ready to move to
CSS-P and DIVs just yet.

But I'm being told our policies were contradictory. If we're going to
use standards, then we should use CSS positioning not TABLE code.
That's correct.
But we _are_ using standards! We're using valid HTML with a DOCTYPE
and everything. We don't use the FONT tag (though even _that_ is still
valid in Transitional HTML, did you notice?) and all the formatting,
all the backgrounds and colors and images and fonts are in the style
sheet, not in the page.
Misusing <table> for a layout grid is just as unacceptable as misusing
<blockquote> as an "indent text command".
What, after all, is the real difference between

-------- ------------------------ --------
| TD | | TD | | TD | [snip] and

-------- ------------------------ --------
| DIV | | DIV | | DIV | [snip] anyway? The content comes in the same order in the page, and if I
include a "skip to content" link that takes people to the centre TD,
who have I hurt?
The former is structurally inaccurate. Some browsing situations may also
need to handle tables differently from running text and text enclosed in
<div>. Your layout box disguised as <table> may well be treated like an
actual data table, even if you do not intend that.
Tables should only be used for Tabular content, I hear you say --
well, isn't the traditional layout tabular, in a way?
No, the structure of content doesn't change just because you want the page
layout to be a certain way.
I forgot my original question -- oh yeah, where is it written, actually
literally where in the W3 website or the spec is it written that I must
use CSS-P now or my code isn't using standards?


http://www.w3.org/TR/html401/struct/tables.html#h-11.1

"Tables should not be used purely as a means to layout document content as
this may present problems when rendering to non-visual media. Additionally,
when used with graphics, these tables may force users to scroll
horizontally to view a table designed on a system with a larger display. To
minimize these problems, authors should use style sheets to control layout
rather than tables."

(The word "control" probably should have been "suggest" here.)

--
Shawn K. Quinn
Jul 20 '05 #7
On 14 Jun 2004 21:52:02 -0700, Jack Hughes <ja********@yah oo.com> wrote:
The content comes in the same order in the page


Actually, no. With table layout I must have the left column, then the
center, then the right. With CSS layout I can make the page degrade to ANY
order.
Jul 20 '05 #8
On Tue, 15 Jun 2004, Shawn K. Quinn wrote:
(The word "control" probably should have been "suggest" here.)


"Propose" is perhaps a more neutral - and hence more generally
acceptable - term for it.

Anyway, why all this fuss about "positionin g"? For most purposes, a
bit of flexible sizing and judicious floating works well across a
range of browsers, and does little harm irrespective of whether it's
actioned or not.

Some of the attempts I've seen to position lumps of stuff out of the
flow, however, have failed miserably in real-world situations - all
too often resulting in substantive content getting hidden behind some
insignificant navigation menu or similar. In web page design, often
enough, "less can be more" if the right choices are made. No, I'm not
a graphic designer, don't look to me for demonstrations, but I know
what I've seen.
Jul 20 '05 #9
Neal wrote:
On 14 Jun 2004 21:52:02 -0700, Jack Hughes <ja********@yah oo.com>
wrote:
The content comes in the same order in the page


Actually, no. With table layout I must have the left column, then the
center, then the right. With CSS layout I can make the page degrade
to ANY order.


Not true (about the tables). There are various ways, for example using CSS2,
or the "table trick", of having content order different from visual order.

And with CSS layout, things can sometimes get restricted. For example, if I
want a footer below the rest of the content, I would typically use floats, not
absolute positioning. And then I have to put things into the content in the
right order to get the floats to work. (This is especially a problem if one of
the columns is "remaining-width", because of a flexible-width layout, and
can't be floated).

With both techniques, once the content gets at all complicated, the wrapping &
nesting & sequencing of the top-level elements of the document tree become
important. In that sense, a table is "stereotype d wrapping & nesting".

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
4090
by: Jack Hughes | last post by:
This argument has come up two or three times lately. We have a web standards document at our company that say "Use valid HTML 4; We don't recommend switching to DIV-based CSS-P for layout just yet though, tables are a lot easier." That's because we have a lot of developers who aren't ready to move to CSS-P and DIVs just yet. But I'm...
0
8044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7808
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8096
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6450
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5299
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3739
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1055
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.