没有超出时显示样式,不显示滚动条:
超出时显示滚动条:
1.html
我是表头1我是表头2我是表头3我是表头4
内容1内容2内容3内容4内容1内容2内容3内容4...
2.css 其中td的宽度,每一行的最后一个td不设置宽度,前面的td设置宽度来让表格头部和内容对齐
.table{
width: 500px;
border-collapse:collapse;
background-color: rgba(45,172,255,.1);
border-right: 1px solid rgba(0,175,237,.3);
border-top: 1px solid rgba(0,175,237,.3);
}
.table tr td{
border-bottom: 1px solid rgba(0,175,237,.3);
border-left: 1px solid rgba(0,175,237,.3);
color: #fff;
font-size: 16px;
padding: 5px 10px;
text-align: center;
}
.table tr td:nth-child(1),
.table tr td:nth-child(2),
.table tr td:nth-child(3){
width: 100px;
}
.table>tbody>tr,.table>thead{
display: table;
width: 100%;
table-layout: fixed; /* 重要 表格固定算法 */
}
.table>tbody{
height: 200px;
overflow: hidden;
display: block;
overflow: hidden;
overflow-y: auto;
}
Selenium基础之--01(将浏览器最大化,设置浏览器固定宽、高,操控浏览器前进、后退)
1,将浏览器最大化 我们知道调用启动的浏览器不是全屏的,这样不会影响脚本的执行,但是有时候会影响我们"观看"脚本的执行. coding=utf-8 from selenium im ...
Html - Table 表头固定和 tbody 设置 height 在IE不起作用的解决