On 23 Aug 2006, at 17:24, Peter-Paul Koch wrote: > http://www.quirksmode.org/css/columns.html > > One result took me totally by surprise, and I hope someone on the list > can explain it to me. In my tests I use a <col> tag that spans two > columns: > > <col span="2" style="background-color: #07B133; color: #ffffff; > width: 10em" /> > > Before I did this test, I assumed that the width declaration would > apply to the entire col, i.e. to two columns of table cells. > > However, in a remarkable show of unanimity all tested browsers (IE 5.5 > and 7 Windows, IE 5.2 Mac, Firefox 1.5, Opera 9, Safari 1.3.2 and iCab > 3.0) apply the 10em width to all cells separately, so that the total > width of the two-cell column becomes 20em + cellspacing. > > I went through the specs (CSS: > http://www.w3.org/TR/CSS21/tables.html#q4; HTML: > http://www.w3.org/TR/html4/struct/tables.html#h-11.2.4.2) and could > not find anything that indicates that such a width should be applied > to all cells separately; but maybe I don't understand them well > enough. >
Hi Peter, The definition of the "width" attribute for the "COL" element states that "This attribute specifies a default width for each column spanned by the current COL element." In CSS 2.1 section 6.4.4 "Precedence of non-CSS Presentational Hints" it is stated that "The UA may choose to honor presentational attributes in an HTML source document. If so, these attributes are translated to the corresponding CSS rules with specificity equal to 0, and are treated as if they were inserted at the start of the author style sheet." "Width" is one of the presentational attributes. So, if the width attribute applies to each column, it follows that, for consistency, a width specified only in CSS would also be applied to each column, as shown by your test. Otherwise a UA that correctly followed the definition of the "width" attribute and the rules of 6.4.4 would have to interpret the automagically-created CSS differently from the specified CSS. I hope I've managed to get that across; I know what I mean, but I'm not sure I've explained it very lucidly :-( If it remains unclear, I'll try to find a better way to explain. Cheers, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/