table th表头固定属性设定


/*设置滚动属性*/

tbody {

display: block;

max-height: 400px;

overflow-y: scroll;

}



/*设置头与内容自动对齐*/

table thead,tfoot,tbody tr {

display: table;

width: 100%;

table-layout: fixed;

}



/*给滚动条预留宽度*/

table thead,tfoot {

width: calc( 100% - 1em);

background: #EFF0F5;

}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM