Last Comment Bug 285184 - CSS not rendered for table col or colgroup
: CSS not rendered for table col or colgroup
Status: RESOLVED INVALID
:
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: x86 Windows 2000
: -- normal (vote)
: ---
Assigned To: Blake Ross
:
Mentors:
: 312052 363053 382137 391492 460131 470511 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-07 13:29 PST by Nicholas Shewmaker
Modified: 2008-12-26 06:44 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Nicholas Shewmaker 2005-03-07 13:29:30 PST
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 Stefan [:stefanh] 2005-03-07 14:12:55 PST
> 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
Comment 2 Elmar Ludwig 2005-10-11 08:36:18 PDT
*** Bug 312052 has been marked as a duplicate of this bug. ***
Comment 3 Brian Polidoro 2006-12-07 07:14:30 PST
*** Bug 363053 has been marked as a duplicate of this bug. ***
Comment 4 philippe (part-time) 2007-05-26 17:02:25 PDT
*** Bug 382137 has been marked as a duplicate of this bug. ***
Comment 5 Samuel Sidler (old account; do not CC) 2007-08-09 03:06:04 PDT
*** Bug 391492 has been marked as a duplicate of this bug. ***
Comment 6 Roedy Green 2007-08-09 19:08:02 PDT
In addition <col class="xxx"> is ignored.
Comment 7 robinpelgrim 2008-10-15 15:17:28 PDT
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)
Comment 8 philippe (part-time) 2008-10-15 16:14:01 PDT
*** Bug 460131 has been marked as a duplicate of this bug. ***
Comment 9 Frank Wein [:mcsmurf] 2008-12-25 10:02:46 PST
*** Bug 470511 has been marked as a duplicate of this bug. ***
Comment 10 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2008-12-26 06:44:57 PST
Note that we do support backgrounds on columns, and bug 915 covers inheritance of the HTML attributes that HTML4 says should be inherited.

Note You need to log in before you can comment on or make changes to this bug.