.tablebox { height: 500px; overflow: hidden; position: relative; width: 1000px; margin: 100px auto; background-color: rgba(6,26,103,1); } .tbl-header { width: 100%; position: absolute; top: 0; left: 0; z-index: 999; } .tbl-body { width: 100%; position: absolute; top: 0; left: 0; } .tablebox table { width: 100%; } .tablebox table th, .tablebox table td { font-size: 24px; color: #7ca6f4; line-height: 45px; text-align: center; } .tablebox table tr th { background-color: #1f1f9c; cursor: pointer; } .tablebox table tr td { background-color: transparent; } .tbl-body tr:nth-child(even) td,.tbl-body1 tr:nth-child(even) td { background-color: rgba(31, 31, 156, .5); } .tablebox table tr td span, .tablebox table tr td span { font-size: 24px; }
代码简单易懂,一看就会,自己琢磨