ng-repeat 指令可以完美的显示表格。
AngularJS 表格 语法
ng-repeat 指令可以完美的显示表格。
AngularJS 表格 示例
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.bootcss.com/angular.js/1.6.3/angular.min.js"></script> </head> <body> <div ng-app="myApp" ng-controller="customersCtrl"> <table> <tr ng-repeat="x in names"> <td>{{ x.Name }}</td> <td>{{ x.Country }}</td> </tr> </table> </div> <script> var app = angular.module('myApp', []); app.controller('customersCtrl', function($scope, $http) { $http.get("/try/angularjs/data/Customers_JSON.php") .then(function (result) { $scope.names = result.data.records; }); }); </script> </body> </html>
热门推荐
- Laravel-admin弹窗table组件【改】
- Vue基于iview table展示图片实现点击放大功能
- drop table是什么命令?
- table 中 cellspacing 与 cellpadding 区别
- Angular与angularjs、react和vue的简单对比
- 怎么利用layui美化table数据表格