Striped Tables(스트라이프 테이블)
Striped Tables(스트라이프 테이블)
First Name Last Name Savings
Peter Griffin $100
Lois Griffin $150
Joe Swanson $300
For zebra-striped tables, use the nth-child() selector and add a background-color to all even (or odd) table rows:
Example
tr:nth-child(even) {background-color: #f2f2f2}
<!DOCTYPE html>
<html>
<head>
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2}
</style>
</head>
<body>
<h2>Striped Table</h2>
<p>For zebra-striped tables, use the nth-child() selector and add a background-color to all even (or odd) table rows:</p>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
<td>$100</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
<td>$150</td>
</tr>
<tr>
<td>Joe</td>
<td>Swanson</td>
<td>$300</td>
</tr>
<tr>
<td>Cleveland</td>
<td>Brown</td>
<td>$250</td>
</tr>
</table>
</body>
</html>

게시판 목록
퍼블리셔팁
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 977 | CSS | 8년 전 | 1668 | ||
| 976 | CSS | 8년 전 | 2123 | ||
| 975 | CSS | 8년 전 | 1616 | ||
| 974 | CSS | 8년 전 | 5254 | ||
| 973 | CSS | 8년 전 | 3255 | ||
| 972 | CSS | 8년 전 | 3053 | ||
| 971 | CSS | 8년 전 | 2132 | ||
| 970 | HTML | 8년 전 | 3048 | ||
| 969 | HTML | 8년 전 | 3525 | ||
| 968 | CSS | 8년 전 | 2447 | ||
| 967 | CSS | 8년 전 | 1939 | ||
| 966 | CSS | 8년 전 | 1702 | ||
| 965 | CSS | 8년 전 | 2700 | ||
| 964 | CSS | 8년 전 | 2580 | ||
| 963 | CSS | 8년 전 | 3113 | ||
| 962 | CSS | 8년 전 | 1813 | ||
| 961 | CSS | 8년 전 | 1501 | ||
| 960 | CSS | 8년 전 | 2277 | ||
| 959 | CSS | 8년 전 | 1894 | ||
| 958 | CSS | 8년 전 | 2150 | ||
| 957 | CSS | 8년 전 | 2190 | ||
| 956 | CSS | 8년 전 | 2055 | ||
| 955 | CSS | 8년 전 | 2214 | ||
| 954 | CSS | 8년 전 | 2346 | ||
| 953 | CSS | 8년 전 | 2897 | ||
| 952 | CSS | 8년 전 | 2504 | ||
| 951 | CSS | 8년 전 | 2383 | ||
| 950 | CSS | 8년 전 | 1863 | ||
| 949 | CSS | 8년 전 | 1911 | ||
| 948 | CSS | 8년 전 | 2097 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기