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>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 88 | jQuery Mobile | 8년 전 | 1937 | ||
| 87 | jQuery Mobile | 8년 전 | 1918 | ||
| 86 | jQuery Mobile | 8년 전 | 1528 | ||
| 85 | jQuery Mobile | 8년 전 | 1836 | ||
| 84 | jQuery Mobile | 8년 전 | 1873 | ||
| 83 | jQuery Mobile | 8년 전 | 1887 | ||
| 82 | jQuery Mobile | 8년 전 | 1657 | ||
| 81 | jQuery Mobile | 8년 전 | 1373 | ||
| 80 | jQuery Mobile | 8년 전 | 1811 | ||
| 79 | jQuery Mobile | 8년 전 | 1357 | ||
| 78 | jQuery Mobile | 8년 전 | 1756 | ||
| 77 | jQuery Mobile | 8년 전 | 1782 | ||
| 76 | jQuery Mobile | 8년 전 | 1791 | ||
| 75 | jQuery Mobile | 8년 전 | 1405 | ||
| 74 | jQuery Mobile | 8년 전 | 1543 | ||
| 73 | jQuery Mobile | 8년 전 | 1249 | ||
| 72 | jQuery Mobile | 8년 전 | 1630 | ||
| 71 | jQuery Mobile | 8년 전 | 1622 | ||
| 70 | jQuery Mobile | 8년 전 | 1506 | ||
| 69 | jQuery Mobile | 8년 전 | 1514 | ||
| 68 | jQuery Mobile | 8년 전 | 2051 | ||
| 67 | jQuery Mobile | 8년 전 | 1317 | ||
| 66 | jQuery Mobile | 8년 전 | 1695 | ||
| 65 | jQuery Mobile | 8년 전 | 1187 | ||
| 64 | jQuery Mobile | 8년 전 | 1468 | ||
| 63 | jQuery Mobile | 8년 전 | 1659 | ||
| 62 | jQuery Mobile | 8년 전 | 1640 | ||
| 61 | jQuery Mobile | 8년 전 | 1877 | ||
| 60 | jQuery Mobile | 8년 전 | 1412 | ||
| 59 | jQuery Mobile | 8년 전 | 1968 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기