Closed
Bug 190455
Opened 22 years ago
Closed 22 years ago
no "col" and "colgroup" tag support
Categories
(Core :: DOM: CSS Object Model, defect)
Tracking
()
People
(Reporter: tonn81, Assigned: jst)
Details
Attachments
(1 file)
(deleted),
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021212
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021212
Text in the first and the second column of the table should be red, and in the
third - green. By the way, it is shown correctly in IE6.
Reproducible: Always
Steps to Reproduce:
1.Open page with this tag
2.See a result
Actual Results:
CSS style doesn't apply to columns - text is black
Expected Results:
Full apply CSS style to the columns - right colors, alignment and so one
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--
.normColumn {color: green}
.priceColumn {color: red}
-->
</style>
</head>
<body>
<table>
<colgroup class="normColumn" span="2"></colgroup>
<col class="priceColumn">
<tbody>
<tr><td>8832<td>Yes<td>$255.98</td>
<tr><td>8835<td>No<td>$98</tr>
<tr><td>8832<td>Yes<td>$255.98</td>
<tr><td>8835<td>No<td>$98</tr>
<tr><td>8832<td>Yes<td>$255.98</td>
<tr><td>8835<td>No<td>$98</tr>
</table>
</body>
</html>
*** This bug has been marked as a duplicate of 4510 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Summary: no "col" and "colgroup" tag support → no "col" and "colgroup" tag support
Comment 2•21 years ago
|
||
Changing the bug report's HTML file into a testcase.
Comment 3•21 years ago
|
||
I don't think this bug is marked duplicate correctly. Also, this bug is still in
effect as of
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5b) Gecko/20030903 Firebird/0.6.1+
Comment 4•21 years ago
|
||
'color' doesn't apply to columns and column groups, which would make this INVALID.
Comment 5•21 years ago
|
||
Oh, OK. Can you tell me where it states that in the CSS/HTML specs? Thanks.
Comment 6•21 years ago
|
||
Reporter | ||
Comment 7•21 years ago
|
||
That testcase is taken from HTML 4.0 specification.
I don't know the exact adress, but page
http://deboer.narod.ru/design/html/COL.html is seems to be copyed from some
reference.
That's why it isn't INVALID!
Reporter | ||
Comment 8•21 years ago
|
||
From http://www.w3.org/TR/html4/struct/tables.html#h-11.2.4
"The COL element allows authors to share attributes among <...> columns <...>"
And such properties as class and style are included.
Also, the original meaning of the COL tag is to apply all his properties to its
cells.
P.S. http://deboer.narod.ru/design/html/COL.html is a link to Dreamweaver's HTML
reference...
Comment 9•21 years ago
|
||
Yes. You can use the class and style attribute on col and colgroup. But that
doesn't change the fact that only the four properties mentioned at the URI I
quoted can have any effect. The HTML specification cannot change the meaning of
the CSS specification.
The HTML4 spec does not, as far as I can tell, have any example like the
testcase attached to this bug.
The Dreamweaver HTML reference is in error.
Reporter | ||
Comment 10•21 years ago
|
||
I agree that code like <col color='red'> is invalid, but <col style='color:red'>
is right and should work.
So, if it doen't work, it's a bug that should be fixed.
Comment 11•21 years ago
|
||
<col style="color: red"> should, according to the CSS specifications, have no
effect, because 'color' does not apply to columns, as described by section 17.3:
http://www.w3.org/TR/CSS21/tables.html#q4
...which lists four properties that apply to columns, none of which are the
'color' property.
Reporter | ||
Comment 12•21 years ago
|
||
So, here are some confusions:
1. In HTML 4 spec. (http://www.w3.org/TR/html4/struct/tables.html#h-11.2.4) is
sayed that "The COL element allows authors to share attributes among <...>
columns <...>", and class and style are in list of COL's attributes. And there's
no statement that properties are applyed particularly! So, IMHO, artibutes
should apply completely to cells.
2. In HTML 4 spec. (http://www.w3.org/TR/html4/struct/tables.html#edef-COL) is
stated that COL has such atributes has cellhalign, callvalign and they should by
applyed to col's cells. But in your CSS 2 spec. these atributes are not
included! It means that you can set these parameters by HTML, but not by CSS!
IMHO, it says only the one thing - CSS and HTML has significant difference in
that part, and taking in consideration that HTML is more developed, i should
conclude that we should follow HTML spec.
3. Even if standarts says to ignore all atributes than border, background,
width, visibility, such restrictions are seemed for me as a web-developer
incomprehensible, strange, odd and harmful. Especially when this feature is
supported by IE. I guess CSS 2 is not well-developed in that part, and in next
its version it will be fixed. Then, it's better to do it earlier.
Comment 13•21 years ago
|
||
> 1. In HTML 4 spec. (http://www.w3.org/TR/html4/struct/tables.html#h-11.2.4) is
> sayed that "The COL element allows authors to share attributes among <...>
> columns <...>", and class and style are in list of COL's attributes. And
> there's no statement that properties are applyed particularly! So, IMHO,
> artibutes should apply completely to cells.
Yes. The *attributes* apply completely to cells. I am not denying that. One of
these attriutes is "style". However, the HTML spec does not say how to handle
the _contents_ of the "style" attribute, that is purely up to the CSS spec.
> 2. In HTML 4 spec. (http://www.w3.org/TR/html4/struct/tables.html#edef-COL) is
> stated that COL has such atributes has cellhalign, callvalign and they should
> by applyed to col's cells. But in your CSS 2 spec. these atributes are not
> included!
CSS doesn't include _any_ attributes -- attributes and properties are totally
different things.
> It means that you can set these parameters by HTML, but not by CSS!
No, you can still set the alignment of cells in CSS, you just have to do it
directly on the cell, instead of indirectly through the column.
> IMHO, it says only the one thing - CSS and HTML has significant difference in
> that part, and taking in consideration that HTML is more developed, i should
> conclude that we should follow HTML spec.
The HTML spec and the CSS spec here are not mutually exclusive. We should
support those attributes that are listed in the HTML spec. (If we don't, see bug
991.) And we should follow the CSS spec when it comes to CSS properties. The two
can be followed at the same time.
> 3. Even if standarts says to ignore all atributes than border, background,
> width, visibility, such restrictions are seemed for me as a web-developer
> incomprehensible, strange, odd and harmful.
It is actually because in the CSS model there is nothing that says that COL
elements have to be columns, except if you say:
col { display: table-column; }
...which happens to be the default for that element. Because of the way CSS
works, with the cascade and so forth, it is basically impossible to get styles
applied to a column to be propagated to a cell.
> Especially when this feature is supported by IE.
IE doesn't support display: table-column, and it doesn't support color: inherit,
so it doesn't have this problem. Note that there is nothing in any spec that
says how to determine the colour of a cell if the 'color' property is set on
both the cell, the row, and the column, if you ignore the CSS spec's restriction
about which properties apply to columns, and therefore it is hard to know what
IE is really doing.
> I guess CSS 2 is not well-developed in that part, and in next its version it
> will be fixed. Then, it's better to do it earlier.
Nobody has yet proposed a solution to the cascade problem. If you have an idea,
please submit it to the www-style@w3.org mailing list.
Reporter | ||
Comment 14•21 years ago
|
||
Hm.. So many words are sayed, so i don't how to start..
First of all, about initial meaning of COL of any element that has {display:
table-column} property. Its original meaning is to operate with columns instead
of each cell. So, its only meaning is representation of group of cells (column),
and then you operate with cell through COL the same as you operate with the
cell, i.e. ALL set properties and atributes are applied to cell. And there's no
reason to restict attributes and properties applied, because it is only link /
pointer / representation of cells.
The second, about properties apying order. Solution is very simple:
table => table-column-group => table-column => table-row-group => table-row => cell
or in html:
table => colgroup => col => tbody => row => cell
So, to get cell's atributes and css properties, browser should apply then in
mentioned above order.
And, to mention IE - it shows testcase correct. ;-)
Comment 15•21 years ago
|
||
> [COL's] original meaning is to operate with columns instead of each cell. So,
> its only meaning is representation of group of cells (column), and then you
> operate with cell through COL the same as you operate with the cell, i.e. ALL
> set properties and atributes are applied to cell.
There is no specification that I am aware of that backs up that statement.
According to HTML, <col> is purely a way of indicating semantics on a per-column
basis. According to CSS, <col> is just a normal element, and the rules are
applied identically to it as to any other display:table-column element.
> And there's no reason to restict attributes and properties applied, because it
> is only link / pointer / representation of cells.
I have already listed several reasons, the main one being that the CSS model
simply doesn't work that way (more on this next:).
> The second, about properties apying order. Solution is very simple: table =>
> table-column-group => table-column => table-row-group => table-row => cell
> or in html: table => colgroup => col => tbody => row => cell
Unfortunately, you don't _know_ that an element is a table, or table-cell, or
whatever, until _after_ you have applied the properties and done the inheritance
and so forth.
The way CSS works is:
1. first you find the values of all the properties for the root element
2. next you find the values of all the properties for each element in turn,
applying inheritance at each element.
3. finally, you use the styles to draw the document, linking elements that
are in tables together, creating anonymous blocks where required.
You don't _know_ that a table cell is a table cell, or what element represents
its column (if any), until after you have established its colour, because it's
only in the next step (the third above) that you link the elements together.
> And, to mention IE - it shows testcase correct. ;-)
No, it shows the testcase as you expect, but it is not correct according to the
relevant standards.
You need to log in
before you can comment on or make changes to this bug.
Description
•