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년 전 | 1436 | ||
| 177 | AngularJS | 8년 전 | 1208 | ||
| 176 | AngularJS | 8년 전 | 1277 | ||
| 175 | AngularJS | 8년 전 | 1373 | ||
| 174 | AngularJS | 8년 전 | 1145 | ||
| 173 | AngularJS | 8년 전 | 1889 | ||
| 172 | AngularJS | 8년 전 | 1440 | ||
| 171 | AngularJS | 8년 전 | 1132 | ||
| 170 | AngularJS | 8년 전 | 1396 | ||
| 169 | AngularJS | 8년 전 | 1191 | ||
| 168 | AngularJS | 8년 전 | 1007 | ||
| 167 | AngularJS | 8년 전 | 1973 | ||
| 166 | AngularJS | 8년 전 | 1045 | ||
| 165 | AngularJS | 8년 전 | 1111 | ||
| 164 | AngularJS | 8년 전 | 1316 | ||
| 163 | AngularJS | 8년 전 | 1158 | ||
| 162 | AngularJS | 8년 전 | 1376 | ||
| 161 | AngularJS | 8년 전 | 1380 | ||
| 160 | AngularJS | 8년 전 | 1137 | ||
| 159 | AngularJS | 8년 전 | 1097 | ||
| 158 | AngularJS | 8년 전 | 1515 | ||
| 157 | AngularJS | 8년 전 | 1483 | ||
| 156 | AngularJS | 8년 전 | 1332 | ||
| 155 | AngularJS | 8년 전 | 1219 | ||
| 154 | AngularJS | 8년 전 | 1626 | ||
| 153 | AngularJS | 8년 전 | 1113 | ||
| 152 | AngularJS | 8년 전 | 1533 | ||
| 151 | AngularJS | 8년 전 | 1431 | ||
| 150 | AngularJS | 8년 전 | 1126 | ||
| 149 | AngularJS | 8년 전 | 1650 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기