Closed Bug 262232 Opened 20 years ago Closed 20 years ago

<col> tags css background formatting when using style or class attributes is ignored

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mark_fierling, Assigned: bugzilla)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10

here's some html to illustrate the problem:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
#tab {border-collapse:collapse;width:100%;}
#tab td {border:1px dotted black;}
.number {text-align:right;background:red;}
</style>
</head>
<body>
<table id="tab" cellspacing="0">
<col><col style="text-align:center;"><col class="number">
<tbody>
	<tr><td>a1</td><td>b1</td><td>c1</td></tr>
	<tr><td>a2</td><td>b2</td><td>c2</td></tr>
	<tr><td class="number">a3</td><td style="text-align: right;">b3</td><td
style="text-align: center;">c3</td></tr>
	<tr><td>a4</td><td>b4</td><td>c4</td></tr>
</tbody>
</table>
</body>
</html>

this table should be rendered with the second column text centered and the thrid
column text right aligned and red. The third row is rendered correctly as the
css is applied at the cell level (except that the third cell - c3 - should be
red, as it should inherit the css from the col tag).

Note that i've reported this bug incorrectly before (#262159), as i was made
aware, text-align and color are not supported for the col tag according to the
css 2.1 specs (http://www.w3.org/TR/CSS21/tables.html#q4).

However according to the specs 'background' IS valid in col tags...
from the above w3.org link (17.3 Columns)...
----------------
The following properties apply to column and column-group elements:
...
'background'
    The background properties set the background for cells in the column, but
only if both the cell and row have transparent backgrounds. See "Table layers
and transparency."
-----------------

also, interestingly enough i've noticed that when changing the doctype to strict
(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">) everything works
exactly like IE, even the text-align and color in the col tags - effectively
extending the css2.1 specs - VERY COOL.

anyway, please let me know if i'm missing something or if the css background not
working in col tags is infact a bug.

Thanks

Reproducible: Always
Steps to Reproduce:
1.paste the html code above into a texteditor (ie. notepad)
2.save as test.htm onto your computer (ie. desktop)
3.open the test.htm file in Firefox/Mozilla and observe the incorrect behaviour.
4.open in IE or any other recent, non mozilla based browser and see how it
should be interpreted.

Actual Results:  
renders incorrectly - the col tag background css is completely ignored when the
table is rendered.

Expected Results:  
it should use the css specified inside the col tags to render the table correctly.
Please search bugzilla before filing bugs.

*** This bug has been marked as a duplicate of 915 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
This is not a dup of 915.  If you take a minute to test this, you would have
found that it works on the FF trunk.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
This was presumably fixed on the main trunk before FF branched for 1.0.  The
sample code here works in the 20040927 trunk build.

It will eventually work in post-1.0 FF releases.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → WORKSFORME
(In reply to comment #3)
> This was presumably fixed on the main trunk before FF branched for 1.0.  The
> sample code here works in the 20040927 trunk build.
> 
> It will eventually work in post-1.0 FF releases.

Fixed on the trunk after the branch, not before, that is.
Ah ok, too early for duping bugs i guess. Anyway this one should be duped to the
bug that fixed this.
bug 262159 should be mark as dup of this, i didn't see this bug "Resolution:  
WORKSFORME" and posted there
You need to log in before you can comment on or make changes to this bug.