Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
AngularJS Table with CSS Styles Example
Keywords : Angularjs table styles example, Angularjs table with css effects example, Angularjs table with alternative row colors example, Angularjs change style of table example
Example
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> AngularJs Tables with CSS Styles Example </title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script type="text/javascript"> var app = angular.module("tablesApp", []); app.controller("tablesCtrl", function ($scope) { $scope.users = [{ name: "Madhav Sai", age: 30, location:'Nagpur' }, { name: "Suresh Dasari", age: 29, location:'Chennai' }, { name: "Rohini Alavala", age: 29, location:'Chennai' }, { name: "Praveen Kumar", age: 24, location:'Bangalore' }]; }); </script> <style type="text/css"> table, tr , td { border: 1px solid grey; border-collapse: collapse; padding: 5px; } table tr:nth-child(odd) { background-color: #d6f1f8; } table tr:nth-child(even) { background-color: #ffffff; } </style> </head> <body ng-app="tablesApp"> <div ng-controller="tablesCtrl"> <h2>AngularJS Tables with CSS Styles</h2> <table> <tr> <td>Name</td> <td>Age</td> <td>Location</td> </tr> <tr ng-repeat="user in users"> <td>{{user.name}}</td> <td>{{user.age}}</td> <td>{{user.location}}</td> </tr> </table> </div> </body> </html>
Click Here to See Result
Result
Previous
Next