感觉这个 CSS 写的很好,简洁又好看!
- <style>
- table, th , td {
- border: 1px solid grey;
- border-collapse: collapse;
- padding: 5px;
- }
- table tr:nth-child(odd) {
- background-color: #f1f1f1;
- }
- table tr:nth-child(even) {
- background-color: #ffffff;
- }
- </style>
- <p ng-app="myApp" ng-controller="customersCtrl">
- <table>
- <tr ng-repeat="x in names">
- <td>{{ x.Name }}</td>
- <td>{{ x.Country }}</td>
- </tr>
- </table>
- </p>
来源: https://www.2cto.com/kf/201712/706704.html