By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,739 Members | 1,081 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,739 IT Pros & Developers. It's quick & easy.

table geometry validation

P: n/a
Hello,

I always validate the output of my CGI scripts against the DTDs to
make sure I'm producing clean pages. However I notice that there are
a class of errors that are outside the scope of DTD validation, namely
table geometry problems.

Examples:

* I put a

td rowspan="2" ...

in one row but forget to skip the appropriate column in the next row.

* I put in width attributes on the tds to help a big table render
quickly, but my widths add up to more than 100%.

These lead to unexpected and broken output in many browsers.

Are there any batch tools to check these kind of problems? Are there
any debug modes of common browsers that report when the table appears
to be broken?

I'd be grateful for any pointers!

-James
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
James Leifer <Ja**********@inria.fr> wrote:
I always validate the output of my CGI scripts against the DTDs to
make sure I'm producing clean pages.
You cannot make that sure by just validating your script output.
However I notice that there are
a class of errors that are outside the scope of DTD validation, namely
table geometry problems.
Surely.
* I put a

td rowspan="2" ...

in one row but forget to skip the appropriate column in the next row.
This is far beyond the scope of validation. In HTML, rowspan is declared
NUMBER, i.e. a digit sequence. In XHTML, it's CDATA, meaning "anything
goes" (as far as DTDs are considered).
* I put in width attributes on the tds to help a big table render
quickly, but my widths add up to more than 100%.
Validators won't even catch width="hello world!", since the width
attribute is declared CDATA (since both numbers and percentages are
allowed, and there's really no way to describe this restriction in SGML,
still less in XML).
Are there any batch tools to check these kind of problems?


I don't think so. If you find a candidate, make sure you double check
what the tool actually does. Most "HTML checkers" other than validators
include subjective and even completely wrong checks.

Besides, it's not an error to have e.g. a table where rows have different
numbers of cells. Such a table may sound odd, and the interpretation of
its structure might be debatable, and there are really no rules on how
the feature should be reflected in visual presentation, but it would be
wrong to flag a page as erroneous just because of such a phenomenon.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2

P: n/a
"Jukka K. Korpela" <jk******@cs.tut.fi> writes:
I always validate the output of my CGI scripts against the DTDs to
make sure I'm producing clean pages.
You cannot make that sure by just validating your script output.


Agreed. The fact that one run produces correct output doesn't mean
that all runs will. ``Don't want no fallacious induction here.'' 8-)

One can do better though: languages such as cduce (www.cduce.org) give
compile-time guarantees that the XML output of *all* runs will conform
to any specification you choose (e.g. xhtml 1.1 strict). I am
starting to experiment with this.

<snip>
Most "HTML checkers" other than validators include subjective and
even completely wrong checks.
Right on. I always use the WDG validator.

<snip>
Besides, it's not an error to have e.g. a table where rows have different
numbers of cells.


Sure, in general it could be sensible. But in practice it indicates a
bug in my CGI and spells trouble for browser compatability. I wanted
a tool to make sure my programs weren't doing that by mistake.

-James
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.