...

View Full Version : <col> style in mozilla



joh6nn
11-15-2002, 03:32 AM
i'm trying to assign some styling to col's in a table. it's working just as i'd expected in IE, but it's not working at all in moz. here's a mock up of what i've got ( this isn't online yet, or i'd link to it ):

<table id="content" border="0" cellpadding="0" cellspacing="0" columns="4">
<colgroup>
<col id="left" />
<col span="2" />
<col id="right" />
</colgroup>
<tr height="100">
<td>column 2</td>
<td>column 2</td>
<td>column 3</td>
<td>column 4</td>
</tr>
<tr height="100">
<td>column 1</td>
<td colspan="2">column 2</td>
<td>column 3</td>
</tr>
<tr height="100">
<td>column 2</td>
<td>column 2</td>
<td>column 3</td>
<td>column 4</td>
</tr>
</table>

and in my style sheet, i've got this:

#left {
background: url("../beta/left.gif") repeat-y;
background-position: left top;
width: 100px;
}

#right {
background: url("../beta/right.gif") repeat-y;
background-position: right top;
width: 100px;
}

MCookie
11-15-2002, 09:42 AM
When I replaced the <col span="2"> it looked better. But still, for a strange reason the background image doesn't show in Mozilla.
I never used col groups, but according to DevGuru, background-image is not part of the attributes for col group. Maybe it's that. Not supported?
http://www.devguru.com/Technologies/html/quickref/html_colgroup.html

<colgroup>
<col id="left" />
<col span="2" />
<col id="right" />
</colgroup>

<colgroup>
<col id="left" />
<col id="" />
<col id="" />
<col id="right" />
</colgroup>

joh6nn
11-15-2002, 03:34 PM
an interesting observation, and that's probably the problem, but i have to wonder then, how'm i supposed to assign the same background to an entire column, without hitting each cell? any ideas?

also, i've gotta wonder, why am i allowed to assign <col>s style attributes, if they're not going to be displayed?

jkd
11-15-2002, 04:52 PM
tr > td:nth-child(even) {
background: white;
}
tr > td:nth-child(odd) {
background: gray;
}

The (future) joys of CSS3... :)

MCookie
11-15-2002, 05:39 PM
Every tutorial on the web has pages about <col> and <colgroup>. They all say: "Supported by version 4 browsers and up". Yet it looks like IE is the only browser supporting the style attribute. Can't get it to work in any version of NN, Opera or Mozilla.

joh6nn
11-15-2002, 10:10 PM
so what you're saying, is that there's nothing wrong with my code, but rather, IE is the only one that's getting this right?

::sigh::

that means 1) i have to assign every cell a background image, in order to get this cross browser. ::shakes fist-o-anger at the gods of compatability:: , and 2) i have to file a bug report with mozilla.

oh well. thanks for confirming my fears, MCookie.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum