`
fogtower
  • 浏览: 57507 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

用CSS实现隔列变色的技术

    博客分类:
  • CSS
阅读更多

看了zhangjunji111的文章一个用CSS实现隔行变色的技术

想起了自己过去的一篇文章

十个最简单实用的Table设计模板

里面提到了用css+html来实现隔列变色的技术

使用 colgroupcol 这两个元素属性来定义不同列的 CSS

 

 

<table>
 
    <!-- Colgroup -->
	   <colgroup>
	      <col class="vzebra-odd">
	      <col class="vzebra-even">
	      <col class="vzebra-odd">
	      <col class="vzebra-even">
	   </colgroup>
 
    <!-- Table header -->
	   <thead>
	      <tr>
	         <th scope="col" id="vzebra-comedy">Employee</th>
	         ...
	      </tr>
	   </thead>
	   ...
</table>

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics