div+css 制作表格

2018-06-24 01:44:06来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

<div class="table">  
        <h2 class="table-caption">花名册:</h2>  
        <div class="table-column-group">  
            <div class="table-column"></div>  
            <div class="table-column"></div>  
            <div class="table-column"></div>  
        </div>  
        <div class="table-header-group">  
            <ul class="table-row">  
                <li class="table-cell">序号</li>  
                <li class="table-cell">姓名</li>  
                <li class="table-cell">年龄</li>  
            </ul>  
        </div>  
        <div class="table-footer-group">  
            <ul class="table-row">  
                <li class="table-cell">footer</li>  
                <li class="table-cell">footer</li>  
                <li class="table-cell">footer</li>  
            </ul>  
        </div>  
        <div class="table-row-group">  
            <ul class="table-row">  
                <li class="table-cell">1</li>  
                <li class="table-cell">John</li>  
                <li class="table-cell">19</li>  
            </ul>  
            <ul class="table-row">  
                <li class="table-cell">2</li>  
                <li class="table-cell">Mark</li>  
                <li class="table-cell">21</li>  
            </ul>  
            <ul class="table-row">  
                <li class="table-cell">3</li>  
                <li class="table-cell">Kate</li>  
                <li class="table-cell">26</li>  
            </ul>  
        </div>  
    </div> 

css

ul{margin:0;padding:0;list-style:none;}  
.table{display:table;border-collapse:collapse;border:1px solid #ccc;}  
.table-caption{display:table-caption;margin:0;padding:0;font-size:16px;}  
.table-column-group{display:table-column-group;}  
.table-column{display:table-column;width:100px;}  
.table-row-group{display:table-row-group;}  
.table-row{display:table-row;}  
.table-row-group .table-row:hover,.table-footer-group .table-row:hover{background:#f6f6f6;}  
.table-cell{display:table-cell;padding:0 5px;border:1px solid #ccc;}  
.table-header-group{display:table-header-group;background:#eee;font-weight:bold;}  
.table-footer-group{display:table-footer-group;} 

  

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:如何简单方便的用字体代替页面中常见常用的小图标小按钮(上)

下一篇:用CSS3来代替JS实现交互