首页 > 解决方案 > Angular JS - 可排序表

问题描述

我正在使用 AngularJS 开发一个项目,但在对表中的列进行排序时遇到了一些困难。我尝试了很多方法和 javascript 库,但表中的数据是动态的,所以到目前为止没有任何效果。有人可以告诉我如何尝试我的案子吗?在此先感谢:) 这是我的桌子:

<table class="table table-sm table-dark table-bordered" id="tabela">
            <thead>
              <tr>
                <th class="headers" ng-repeat="header in headers track by $index"">{{header}}</th>

              </tr>
            </thead>  
            <tbody>
              <tr ng-repeat="row in rows">
                <td class="tbody" ng-repeat="data in row track by $index">{{data}}</td>
              </tr>
            </tbody>
          </table>

标签: javascriptangularjsdatatablesortablejs

解决方案


推荐阅读