Html
    Css
    Js

    
                        
.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;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

table表格无缝向上滚动

代码简单易懂,一看就会,自己琢磨

2
      Changing0
      2018/3/30 16:54:52
      您好,如果表头需要去掉颜色,显示后面的背景颜色该怎么弄,
          西瓜0
          2018/3/30 21:28:24
          css ,37行 background-color: #fff;
      回复