Angularjs form and sample code _ANGULARJS

Source: Internet
Author: User

Lattice data is usually repetitive in nature. Ng-repeat directives, which can be used to easily draw tables. The following example demonstrates using the Ng-repeat directive to draw a table.

<table>
  <tr>
   <th>Name</th>
   <th>Marks</th>
  </tr>
  <tr ng-repeat= "subject in Student.subjects" > <td>{{subject.name}}</td> <td>{{
   Subject.marks}}</td>
  </tr>
</table>

Tables can be styled using CSS styles, as follows:

<style>
table, Th, td {
  BORDER:1PX solid grey;
  Border-collapse:collapse;
  padding:5px;
}
Table Tr:nth-child (odd) {
  background-color: #f2f2f2;
}
Table Tr:nth-child (even) {
  background-color: #ffffff;
}
</style>

Example

The following example shows all of the above instructions.

Testangularjs.html

 

Output

Open textangularjs.html in your Web browser and see the following results:

The above is ANGULARJS form the basic knowledge of the collation, follow-up continue to collate relevant knowledge, thank you for your support of this site!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.