如何在不使用数据表的情况下使表响应?

时间:2019-01-21 11:11:54

标签: php html

如何在不使用datatables和bootstrap的情况下使表响应。如何在移动视图中拆分表?

1 个答案:

答案 0 :(得分:0)

使用此格式 html

<div class="table-responsive">
  <table class="table">
    ...
  </table>
</div>

CSS

.table-responsive {
   display: block;
   width: 100%;
   overflow-x: auto;
   -webkit-overflow-scrolling: touch;
   -ms-overflow-style: -ms-autohiding-scrollbar;
}
.table {
   width: 100%;
}