2014-12-13 188 views
0

我已在電腦上下載了此plunkr (http://plnkr.co/edit/ISa4xg?p=preview)的壓縮文件。當我運行示例時,表格顯示,但css樣式不適用(例如,分頁的方式很糟糕)。任何人都知道爲什麼我有這個問題?ngtable無法正常顯示

在此先感謝。

回答

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> 
+0

請你[編輯]中的原因作出解釋這段代碼回答了這個問題?僅限代碼答案[阻止](http://meta.stackexchange.com/q/148272/274165),因爲他們沒有教導解決方案。 – 2015-11-02 03:30:37