Closed Bug 285184 Opened 19 years ago Closed 19 years ago

CSS not rendered for table col or colgroup

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: nshewmaker, Assigned: bugzilla)

References

Details

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. ;)
> 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
Closed: 19 years ago
Component: General → Style System (CSS)
Product: Firefox → Core
Resolution: --- → INVALID
Version: unspecified → Trunk
*** Bug 312052 has been marked as a duplicate of this bug. ***
*** Bug 363053 has been marked as a duplicate of this bug. ***
In addition <col class="xxx"> is ignored.
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)
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.