table test

imjingu·2023년 7월 4일
0

개발공부

목록 보기
45/481
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
         table, td, th {
            border: 1px solid black; /* 테두리 스타일 */
            border-collapse: collapse;
        }

        caption {
            caption-side: bottom;
        }

        td, th {
            padding: 10px;
        }

        .heading {
            background-color: #eee;
        }

    </style>
</head>
<body>
    <table border="1">
        <caption>2020 국민 독서실태</caption>
        <thead>
            <tr class="heading">
                <th>구분</th>
                <th>성인</th>
                <th>학생</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <th class="heading">독서율</th>
                <td>65.3%</td>
                <td>94.9%</td>
            </tr>
            <tr>
                <th class="heading">연평균 독서량</th>
                <td>9.1권</td>
                <td>29.8권</td>
            </tr>
            <tr>
                <th class="heading">공공도서관 이용률</th>
                <td>28.2%</td>
                <td>64.9%</td>
            </tr>
        </tbody>
    </table>
</body>
</html>

0개의 댓글