AngularJS CSS 스타일로 표시하기
AngularJS CSS 스타일로 표시하기
ng-repeat 지시어는 테이블을 표시하는 데 적합합니다.
테이블에 데이터 표시
각도가있는 표를 표시하는 것은 매우 간단합니다.
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>
[전체소스]
<!DOCTYPE html>
<html>
<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>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<table>
<tr ng-repeat="x in names">
<td>{{ x.Name }}</td>
<td>{{ x.Country }}</td>
</tr>
</table>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("customers.php")
.then(function (response) {$scope.names = response.data.records;});
});
</script>
</body>
</html>
ng-repeat 지시어는 테이블을 표시하는 데 적합합니다.
테이블에 데이터 표시
각도가있는 표를 표시하는 것은 매우 간단합니다.
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>
[전체소스]
<!DOCTYPE html>
<html>
<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>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<table>
<tr ng-repeat="x in names">
<td>{{ x.Name }}</td>
<td>{{ x.Country }}</td>
</tr>
</table>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("customers.php")
.then(function (response) {$scope.names = response.data.records;});
});
</script>
</body>
</html>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 178 | AngularJS | 8년 전 | 1417 | ||
| 177 | AngularJS | 8년 전 | 1190 | ||
| 176 | AngularJS | 8년 전 | 1268 | ||
| 175 | AngularJS | 8년 전 | 1362 | ||
| 174 | AngularJS | 8년 전 | 1131 | ||
| 173 | AngularJS | 8년 전 | 1871 | ||
| 172 | AngularJS | 8년 전 | 1425 | ||
| 171 | AngularJS | 8년 전 | 1121 | ||
| 170 | AngularJS | 8년 전 | 1387 | ||
| 169 | AngularJS | 8년 전 | 1184 | ||
| 168 | AngularJS | 8년 전 | 997 | ||
| 167 | AngularJS | 8년 전 | 1960 | ||
| 166 | AngularJS | 8년 전 | 1032 | ||
| 165 | AngularJS | 8년 전 | 1095 | ||
| 164 | AngularJS | 8년 전 | 1293 | ||
| 163 | AngularJS | 8년 전 | 1139 | ||
| 162 | AngularJS | 8년 전 | 1357 | ||
| 161 | AngularJS | 8년 전 | 1365 | ||
| 160 | AngularJS | 8년 전 | 1116 | ||
| 159 | AngularJS | 8년 전 | 1081 | ||
| 158 | AngularJS | 8년 전 | 1494 | ||
| 157 | AngularJS | 8년 전 | 1465 | ||
| 156 | AngularJS | 8년 전 | 1313 | ||
| 155 | AngularJS | 8년 전 | 1207 | ||
| 154 | AngularJS | 8년 전 | 1604 | ||
| 153 | AngularJS | 8년 전 | 1066 | ||
| 152 | AngularJS | 8년 전 | 1472 | ||
| 151 | AngularJS | 8년 전 | 1405 | ||
| 150 | AngularJS | 8년 전 | 1101 | ||
| 149 | AngularJS | 8년 전 | 1629 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기