The default bug view has changed. See this FAQ.

CSS not rendered for table col or colgroup

RESOLVED INVALID

Status

()

Core
CSS Parsing and Computation
RESOLVED INVALID
12 years ago
8 years ago

People

(Reporter: Nicholas Shewmaker, Assigned: Blake Ross)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050223 Firefox/1.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050223 Firefox/1.0.1

I have created a <table> structure and am trying to format it with CSS (see
attached code). I want the data in the first column to be in bold, so I set
"col#first" to do so, with no results.  "col#first td" also failed, even when I
set all "td" to explicitly inherit font-weight.  The same is true for all col's
in my table (it's not just a case of the first one).

"col#first" does successfully set the background-color of all included cells
(the column).

Reproducible: Always

Steps to Reproduce:
<style type="text/css">
td {
	font-weight: inherit;
	color: inherit;
}
col#first {
	font-weight: bold;
	color: red;
	background-color: yellow;
}
col#first td {
	font-weight: bold;
	color: green;
	background-color: blue;
}
</style>
...

<table>
	<col id="first" />
	<col id="second" />
	<col id="third" />
	<tr>
		<td>should be bold</td>
		<td>1-2</td>
		<td>1-3</td>
	</tr>
	<tr>
		<td>should be bold</td>
		<td>2-2</td>
		<td>2-3</td>
	</tr>
</table>


Expected Results:  
The elements in the first column should inherit the settings of col#first.

I'm not sure what the CSS2.1 spec says for this situation, but the HTML4.1 spec
says "the COL element shares its attributes with all the columns it spans". IE
renders as I would expect, but that just leads me to suspect that my
expectations don't match the specifications. ;)

Comment 1

12 years ago
> that just leads me to suspect that my
> expectations don't match the specifications. ;)

Yeah, you can only set borders, background, width and visibility. See
http://www.w3.org/TR/CSS21/tables.html#q4
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Component: General → Style System (CSS)
Product: Firefox → Core
Resolution: --- → INVALID
Version: unspecified → Trunk

Comment 2

12 years ago
*** Bug 312052 has been marked as a duplicate of this bug. ***

Comment 3

10 years ago
*** Bug 363053 has been marked as a duplicate of this bug. ***

Updated

10 years ago
Duplicate of this bug: 382137
Duplicate of this bug: 391492

Comment 6

10 years ago
In addition <col class="xxx"> is ignored.

Comment 7

9 years ago
html401:
The COLGROUP element 

<!ELEMENT COLGROUP - O (COL)*          -- table column group -->
<!ATTLIST COLGROUP
  %attrs;                              -- %coreattrs, %i18n, %events --
  span        NUMBER         1         -- default number of columns in group --
  width       %MultiLength;  #IMPLIED  -- default width for enclosed COLs --
  %cellhalign;                         -- horizontal alignment in cells --
  %cellvalign;                         -- vertical alignment in cells --
  >

this includes style, class etc.

So my guess its not implemented correctly in FF, and the correct way in IE??

(See http://www.w3.org/TR/html401/struct/tables.html#h-11.2.4.1)

Updated

9 years ago
Duplicate of this bug: 460131

Updated

8 years ago
Duplicate of this bug: 470511
Note that we do support backgrounds on columns, and bug 915 covers inheritance of the HTML attributes that HTML4 says should be inherited.
You need to log in before you can comment on or make changes to this bug.