ngtable没有正确显示

时间:2014-12-13 07:27:18

标签: angularjs pagination ngtable

我已在我的计算机上下载了此plunkr (http://plnkr.co/edit/ISa4xg?p=preview)的zip。当我运行该示例时,表格显示但未应用css样式(例如,分页是一种丑陋的方式)。有谁知道为什么我有这个问题?

提前致谢。

1 个答案:

答案 0 :(得分:1)

只是将数据显示到表中的简单示例

//试试这样............

    <!DOCTYPE html>
    <html>
    <script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
    <body>

    <div ng-app="myApp" ng-controller="myCtrl">

    <table border="1">
                <tr>
                    <th data-ng-click="doSort('name')">Name</th>
                    <th data-ng-click="doSort('city')">City</th>
                    <th data-ng-click="doSort('Money')">Money</th>
                </tr>
                <tr data-ng-repeat="person in customer | orderBy:sortBy:reverse | filter:nameText |filter:nameOnly |filter:cityOnly |filter:MoneyOnly">
                    <td> {{ person.name }} </td>
                    <td> {{ person.city}} </td>
                    <td> {{ person.Money}} </td>
                </tr>
            </table>

    </div>

    <script>
    var app = angular.module('myApp', []);
    app.controller('myCtrl', function($scope) {

    $scope.sortBy=  'name';
        $scope.reverse= false;

        $scope.customer= [{name:'Rasel',city:'Dhaka',Money:'10'},
                  {name:'Jon',city:'Khulna',Money:'20'},
                  {name:'Mr. Fox',city:'Rajshahi',Money:'30'},
                  {name:'Nabil',city:'Comilla',Money:'40'}];    

    });
    </script>

    </body>
    </html>