数据表格的thead设置,tr的平分table长度,还有table的边框

虽然都是老掉牙的东西,但是老是记不住,记在这里用的时候随时来查

table 中的tr平分table长度只需要为table指定table-layout: fixed属性即可;

w3c上对table-layout: fixed属性的说明

 automatic 默认。列宽度由单元格内容设定。
 fixed 列宽由表格宽度和列宽度设定。
 inherit 规定应该从父元素继承 table-layout 属性的值。

table设置thead头不动,tbody Y轴滚动

#tblDataList thead {display:block;}
#tblDataList tbody { display:block;height:600px; overflow-y:scroll;overflow-x: hidden;}
#tblDataList thead tr { display:table; width:100%; table-layout:fixed;}
#tblDataList tbody tr {display:table; width:100%; table-layout:fixed;}
#tblDataList thead {width: calc( 100% - 1.17em )}
.ul_inth{ padding: 0px; margin: 0px; border-top: 1px solid;}
.li_inthF{width: 33%;list-style: none;float: left;}
.li_inth{ width: 33%;list-style: none;float: left; border-left: 1px solid;}

表格边框--待续

 

posted @ 2020-05-18 12:18  大尹  阅读(1092)  评论(0编辑  收藏  举报