Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<col class="slick"> does not apply class to the columns of a table

My understanding of col is that it may be used to indicate a class for all the elements in a table's column. This doesn't seem to be working for me though. I can apply the class to individual td's, but I want col to help me avoid this.

Here is the html head:

<head>
<style type="text/css">
 .slick {
  background-color:#b0c4de; /*This always works*/
  border-style:solid; /*This doesn't work when only applied to a <col>*/
  border-width:5px;
 }
</style>
</head>

Interestingly, the background color always works, but the border sometime fails.

Here is the html body:

<body>
<table><tbody>
 <colgroup>
  <col class="slick" />
  <col class="slick" />
 </colgroup>
 <tr id="r1">
  <td><label >Planner/Scheduler/Estimators</label></td>
  <td class="slick"><label >2010</label></td>
 </tr>
</tbody></table>
</body>

Removing the tbody or colgroup tags does not seem to matter. The background is present in both elements; the border is only applied to the second element, where the class is specified in the td tag.

I had a hunch that border wouldn't work with col, but Firebug shows that the slick style isn't applied to the left column at all. What's wrong?

like image 705
jtpereyda Avatar asked Jan 27 '26 06:01

jtpereyda


1 Answers

According to w3 schools, only the width attribute works in Firefox. It also doesn't look like the border attribute is supported at all.

http://www.w3schools.com/tags/tag_col.asp

like image 63
Catfish Avatar answered Jan 29 '26 20:01

Catfish



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!