Home >Web Front-end >CSS Tutorial >Recommend an article using th, colgroup, col to define table styles_Experience exchange

Recommend an article using th, colgroup, col to define table styles_Experience exchange

WBOY
WBOYOriginal
2016-05-16 12:08:022014browse

Define the style of each column of the table. You don’t need to add a bunch of Classes to each td. You can easily do it by using attributes such as th, colgroup, col, etc. ^_^
The code is as follows:

Copy code a> The code is as follows:



  
    
    
    
  
  
    
    
    
  
  
    
    
    
  
  
    
    
     
  
  
    
    
    
  
  
    
    
    
  
  
    
    
    
  
  
    
    
    
  
TagName ClassName CSS
table Demo border-collapse: collapse;
color: #454545;
font: 11px/150% Verdana, Arial, Helvetica, sans-serif;
th padding: 3px 7px;
border: 1px solid #f60;
border-width: 2px 1px 1px;
background: #ffffe1;
td padding: 3px 7px;
border: 1px solid #f60;
col Col1 text-align: right;
background: #f5f5f5;
col Col2 color: #00c;
col Col3 font-style: italic;


抛砖引玉,更多效果就由你DIY了!

[Ctrl A 全选 注:如需引入外部Js需刷新才能执行]

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn