Pure Css fixed table header, and the header alignment table

// control sliding table

table tbody {

display:block;

height:450px;

overflow-y:scroll;

}

// fixed header

table thead, tbody tr {

display:table;

width:100%;

table-layout:fixed;

}

// Header width adjustment

table thead {

background-color:#f5f5f5;

width: calc( 100% - 1.25em );

}

If the header is not aligned with the table below, only need to modify the width: calc (100% - 1.25em); xxem to the

Guess you like

Origin www.cnblogs.com/AsCrazy/p/11538289.html