Create the table in AngularJS

Table data is often repeated in natural order. In AngularJS, ng-repeat directive can be used to draw tables easily. Below is an example of how to use ng-repeat to create tables.

  Ho and Ten   Exam scores  ng-repeat = "printable version of the account.tenMonHoc" > 

To create a style for the table, you can use CSS style.

 

For example:

Below is a specific example for the directive introduced above.

 Tao state in AngularJS  src = "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js" > 

 

 Cavalier AngularJS  ng-app = "ungdungAngularjs" ng-controller = "sinhvienController" >  border = "0" > Nhap ho:  type = "text" ng-model = "sinhvien.ho" > Nhap ten:  type = "text" ng-model = "sinhvien.ten" > Ho and Ten: {{sinhvien.hoten ()}} Mon Hoc:   Ho and Ten   Exam scores  ng-repeat = "printable version of the account.tenMonHoc" > {{monhoc.ten}} {{monhoc.diemthi}} 

Follow tutorialspoint

Previous article: Filter in AngularJS

Next lesson: Instructions for installing AngularJS

5 ★ | 1 Vote

May be interested

  • Instructions for installing AngularJSPhoto of Instructions for installing AngularJS
    in this chapter, i will show you how to install the angularjs library to be used in web application development. we will introduce about the structure of the ink and its contents.
  • MVC structure in AngularJSPhoto of MVC structure in AngularJS
    model view controller or mvc is a popular call, a software design model for web-based applications.
  • Create the first AngularJS applicationPhoto of Create the first AngularJS application
    to start, we start with creating the actual xinchao application by using angularjs, we will show you the specific parts of an angularjs application.
  • Directive in AngularJSPhoto of Directive in AngularJS
    angularjs directive is used to inherit html. there are special attributes that start with the prefix-.
  • Expression in AngularJSPhoto of Expression in AngularJS
    expression is used to bind application data to html tags. expression is written in {{expression}}. expression has a similar way of operating as the ng-bind directive.
  • Controller component in AngularJSPhoto of Controller component in AngularJS
    an angularjs application works primarily based on the controller component to control the flow of data in the application.