/* ------------------------------------------------------- * Filename: JSON data print in table * Website: http://www.shanidkv.com * Description: Shanidkv AngularJS blog * Author: Muhammed Shanid [email protected] ---------------------------------------------------------*/ function githubController($scope,$http) { $http.get("https://api.github.com/users/mralexgray/repos") .success(function(response) {$scope.names = response;}); }
<div ng-app="" ng-controller="githubController"> <table border="0" cellspacing="0" cellpadding="10"> <tr> <th>ID</th> <th>Name</th> </tr> <tr ng-repeat="x in names"> <td>{{ x.id }}</td> <td>{{ x.name }}</td> </tr> </table> </div>
*{ font-family: Arial; font-size:12px; } table{ text-align:center;} table td{ border: 1px solid #ddd; } table th{ background: #ddd; }