1.想要实现表格的thead部分固定切tbody部分可滚动,就需要将thead与tbody进行分离,具体做法是

  1.设置thead,tbody都为display:block;

  2.设置th与td的宽度,强制使其填充整个table的宽度。

     .table thead, .table tbody {
            display: block;
        }

        .table tbody {
            height: 300px;
            overflow-y: auto;
        }

        .table td, .table th {
            width: 460px;
        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-10-21
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2021-06-10
  • 2021-08-22
相关资源
相似解决方案