首页 > Web开发 > 详细

html 表格head部分不动 body部分滚动,格宽同增长

时间:2016-09-20 16:36:42      阅读:300      评论:0      收藏:0      [点我收藏+]

技术分享

<style>
.table{    width: 100%;    border-collapse:collapse;    border-spacing:0;}

.table thead{display: block; width: 100%; background: #ddd;} .table tbody{display: block; height:70px; overflow: auto; width: 100%; border: 1px solid #ddd;} .table td,.table th { width: 200px; border-bottom: none; border-left: none; border-right: 1px solid #CCC; border-top: 1px solid #DDD; padding: 2px 3px 3px 4px } .table tr{ border-bottom: 1px solid #B74; } </style>
<table class="table">
                <thead>
                <tr>
                    <th>header</th>
                    <th>header two</th>
                    <th>header two</th>
                    <th>header two</th>
                    <th>header two</th>
                    <th>header two</th>
                </tr>
                </thead>
                <tbody class="M_scrollBar">
                <tr>
                    <td>fuck 1</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                </tr>
                <tr>
                    <td>fuck 1</td>
                    <td>fuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>kfuc<br>k 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                </tr>
                <tr>
                    <td>fuck 1</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                </tr>
                <tr>
                    <td>fuck 1</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                    <td>fuck 2</td>
                </tr>
                </tbody>
            </table>

 

html 表格head部分不动 body部分滚动,格宽同增长

原文:http://www.cnblogs.com/xiangsj/p/5889106.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!