Web/HTML
[days03] 표 만들고 간단한 속성 넣기
다연
2020. 12. 2. 13:48
반응형
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
table, th, td{
border-collapse: collapse;
}
th,td{
padding:2px;
}
/*tbody tr:nth-child(even){ /*odd, even 홀 짝 */
tbody tr:nth-child(odd){
background-color: #eee;
}
th{
color:white;
background-color: black;
}
tr{
border-bottom:1px dotted gray; /* 밑부분만 점선 */
}
</style>
</head>
<body>
<!-- table[border="1" style="width:100%"]>(tr>th*3>lorem1)+tr*4>td*3>lorem1-->
<table style="width:100%"> <!--border="1" 은 바깥 선 두께 -->
<caption>dept information</caption>
<theader>
<tr>
<th>deptno</th>
<th>dname</th>
<th>loc</th>
</tr>
</theader>
<tbody>
<tr>
<td>Lorem.</td>
<td>Distinctio.</td>
<td>Quo!</td>
</tr>
<tr>
<td>Lorem.</td>
<td>Maxime.</td>
<td>Harum.</td>
</tr>
<tr>
<td>Lorem.</td>
<td>Quis?</td>
<td>Libero.</td>
</tr>
<tr>
<td>Lorem.</td>
<td>Totam.</td>
<td>Doloribus.</td>
</tr>
</tbody>
<tfooter>
</tfooter>
</table>
</body>
</html>
반응형