>> Tables have always been a complete bitch in rendering HTML. Part
>> of the problem is that it is easy to inconsistently overspecify a
>> table (e.g., the whole table must have width 3in but there are
>> only two columns each of which must have width 2 in), and you have
>> to experiment with, say, Internet Explorer, to see how it resolves
>> the problem.
>>
>
>> one would think that knuth had solved it for τεχ. any of it
>> applicable to html?
>
> This is specified in CSS2, clearly and unambiguously. If the sum of
> columns' widths is less than the table's width, one must increase the
> column widths so that they fill the tables width. You don't have to
> experiment with implementations to comply to the specification.
> Unless you have to deal with multipage tables, formatting table, even
> with auto-layout, is a relatively easy task.
>
> And you don't need Knuth and TEX for that.
I hadn't been following CSS2 closely, as I'm out of that business, but you
raised my hopes that someone had finally thought out all these cases and set
down rules. But I just looked at the CSS2 spec and that doesn't seem to be
true. First, while an 'auto layout' algorithm is described, it says "UA's are
not required to implement this algorithm; they can use any other algorithm".
Also, I was just giving off the top of my head an overspecification, and you
are right that it is covered by the CSS2 algorithm, but other cases of
overspecification are left ambiguous: e.g.,
"A percentage value for a column width is relative to the table width.
If the table has 'width: auto', a percentage represents a constraint
on the column's width, which a UA should try to satisfy. (Obviously,
this is not always possible: if the column's width is '110%', the
constraint cannot be satisfied.)"
It doesn't say what to do when you can't satisfy constraints (there are obvious
guesses of course, and they are usually right). However, I do think CSS2 now
does a much better job than the original HTML specs that I had to work from at
tying down layout questions.
This doesn't even get into the problems of ill-formed HTML. I couldn't see
anything in the spec about what to do about
<TR> row stuff ... </TR>JUNK<TR> another row ... </TR>
Does one render the JUNK, and if so, how?
I do agree with Uriel, however, that my initial whine about the pain of tables
ignores that HTML usage has marched on, and the new problems with CSS and
javascript leave libhtml woefully unprepared. Sorry.
Oh - and the comment about TEX: Knuth was a better designer of table
specification - all the questions about how to apportion space in tables come
down to simply applying the general rules re stretchable "glue". So the
algorithm isn't hard, and also doesn't help with the "bad HTML table
specification" problem.
Sorry to ramble on. I guess I'm indulging in nostalgia.
- Howard