방법 - 비교표
CSS로 비교표를 만드는 방법을 알아보세요.
특징 | 기초적인 | 찬성 |
---|---|---|
샘플 텍스트 | ||
샘플 텍스트 | ||
샘플 텍스트 | ||
샘플 텍스트 | ||
샘플 텍스트 |
비교 테이블을 만드는 방법
1단계) HTML 추가:
예시
<!-- Font Awesome Icon Library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<table>
<tr>
<th
style="width:50%">Features</th>
<th>Basic</th>
<th>Pro</th>
</tr>
<tr>
<td>Sample
text</td>
<td><i class="fa fa-remove"></i></td>
<td><i class="fa fa-check"></i></td>
</tr>
<tr>
<td>Sample text</td>
<td><i class="fa fa-check"></i></td>
<td><i class="fa fa-check"></i></td>
</tr>
</table>
2단계) CSS 추가:
예시
/* Style the table */
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
border: 1px solid #ddd;
}
/* Style table
headers and table data */
th, td {
text-align: center;
padding: 16px;
}
th:first-child,
td:first-child {
text-align: left;
}
/* Zebra-striped
table rows */
tr:nth-child(even) {
background-color: #f2f2f2
}
.fa-check {
color: green;
}
.fa-remove {
color:
red;
}