< col class =" slick">不会将类应用于表的列 [英] <col class="slick"> does not apply class to the columns of a table

查看:103
本文介绍了< col class =" slick">不会将类应用于表的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对col的理解是,它可以用来表示表列中所有元素的类。这似乎并不能为我工作。

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.

这里是html头部:

<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.

这里是html体:

<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>

删除tbody或colgroup标签似乎没有关系。背景存在于两个元素中;边框只应用于第二个元素,其中类在td标签中指定。

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.

我有一个hunch的边框不能使用col,但Firebug显示光滑样式根本不应用于左列。

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?

推荐答案

根据w3学校,只有width属性在Firefox中可用。它也看起来不像边界属性被支持。

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

这篇关于&lt; col class =&quot; slick&quot;&gt;不会将类应用于表的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆