rendering table on screen using angularjs -
i trying print table using angularjs,since new unable find better way. getting data shown below
$scope.tabledatas = [{"datamap": { "industrial":["1","12","34"], "axv":["0","18","12"], "com":["1","1","3"], "ind":["1","1","3"], "ixm":["1","1","3"], "adi":["1","1","3"] } }] ;
i want print table inustrial,axv...is column , other data.please how can render using angularjs?
check fiidle may it's looking for
function myctrl($scope) { $scope.tabledatas = [{"datamap": { "industrial":["1","12","34"], "axv":["0","18","12"], "com":["1","1","3"], "ind":["1","1","3"], "ixm":["1","1","3"], "adi":["1","1","3"] } }] ; }
td {border:1px solid #333};
<div ng-app ng-controller="myctrl"> <table> <tr> <td ng-repeat="(k, column) in tabledatas[0].datamap">{{k}}</td> </tr> <tr> <td ng-repeat="(k, column) in tabledatas[0].datamap">{{column[0]}} </td> </tr> <tr> <td ng-repeat="(k, column) in tabledatas[0].datamap">{{column[1]}} </td> </tr> <tr> <td ng-repeat="(k, column) in tabledatas[0].datamap">{{column[2]}} </td> </tr> </table> </div>
Comments
Post a Comment