首页 > 代码库 > html 表格head部分不动 body部分滚动,格宽同增长
html 表格head部分不动 body部分滚动,格宽同增长
<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部分滚动,格宽同增长
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。