ํ ์ด๋ธ์ ๋ค์ ์์ฑ์ ์ฌ์ฉํ์ฌ CSS ์คํ์ผ์ ์ ์ฉํ ์ ์์ต๋๋ค.
1. border
2. border-collapse
3. border-top, border-bottom, border-right, border-left
4. td์ width, height
5. text-align
6. vertical-align
1. border ์์ฑ
border ์์ฑ์ผ๋ก ํ ์ด๋ธ์ ํ ๋๋ฆฌ(border)๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค.
<html>
<head>
<style>
table,
th,
td {
border: 2px solid orange;
}
</style>
</head>
<body>
<table>
<tr>
<td>์ฌ๊ณผ</td>
<td>๋ฐ๋๋</td>
<td>๋ธ๊ธฐ</td>
</tr>
<tr>
<td>์๋ฐ</td>
<td>์๋</td>
<td>์ฒด๋ฆฌ</td>
</tr>
<tr>
<td>ํค์</td>
<td>์ค๋ ์ง</td>
<td>์ฐธ์ธ</td>
</tr>
</table>
</body>
</html>
2. border-collapse ์์ฑ
border-collapse ์์ฑ๊ฐ์ collapse๋ก ์ค์ ํ๋ฉด ํด๋น ํ ์ด๋ธ์ ํ ๋๋ฆฌ๋ ํ ์ค๋ก ํํ๋ฉ๋๋ค.
<html>
<head>
<style>
table,
th,
td {
border: 2px solid orange;
}
table {
border-collapse: collapse;
}
</style>
</head>
<body>
<table>
...์๋ต
</table>
</body>
</html>
3. border-top, border-bottom, border-right, border-left ์์ฑ
๋ค์ ์์ฑ์ top, bottom, right, left ๋ฐฉํฅ์ผ๋ก ํ ๋๋ฆฌ๋ฅผ ์ค์ ํ ์ ์๋ค.
<html>
<head>
<style>
td {
border-bottom: 1px solid blue;
}
</style>
</head>
<body>
<table>
...์๋ต
</table>
</body>
</html>
4. td์ width, height
td์ width, height ์์ฑ์ ์ด์ฉํด ์ ธ์ ํฌ๊ธฐ๋ฅผ ์กฐ์ ํ ์ ์๋ค.
<html>
<head>
<style>
table,
th,
td {
border: 2px solid orange;
}
table {
border-collapse: collapse;
}
td {
width: 200px;
height: 100px;
}
</style>
</head>
<body>
<table>
...์๋ต
</table>
</body>
</html>
5. text-align ์์ฑ
ํ ์ด๋ธ ์์ ๋ด๋ถ์ ํ ์คํธ๋ฅผ ์ํ ๋ฐฉํฅ ์ ๋ ฌ์ ์ค์ ํฉ๋๋ค.
<html>
<head>
<style>
table,
th,
td {
border: 2px solid orange;
}
table {
border-collapse: collapse;
}
td {
width: 200px;
height: 100px;
}
</style>
</head>
<body>
<table>
<tr>
<td>์ฌ๊ณผ</td>
<td>๋ฐ๋๋</td>
<td>๋ธ๊ธฐ</td>
</tr>
<tr>
<td style="text-align: center">์๋ฐ</td>
<td style="text-align: center">์๋</td>
<td style="text-align: center">์ฒด๋ฆฌ</td>
</tr>
<tr>
<td style="text-align: right">ํค์</td>
<td style="text-align: right">์ค๋ ์ง</td>
<td style="text-align: right">์ฐธ์ธ</td>
</tr>
</table>
</body>
</html>
6. vertical-align ์์ฑ
ํ ์ด๋ธ ์์ ๋ด๋ถ์ ํ ์คํธ๋ฅผ ์์ง ๋ฐฉํฅ ์ ๋ ฌ์ ์ค์ ํฉ๋๋ค.
<html>
<head>
<style>
table,
th,
td {
border: 2px solid orange;
}
table {
border-collapse: collapse;
}
td {
width: 200px;
height: 100px;
}
</style>
</head>
<body>
<table>
<tr>
<td style="vertical-align: top">์ฌ๊ณผ</td>
<td style="vertical-align: top">๋ฐ๋๋</td>
<td style="vertical-align: top">๋ธ๊ธฐ</td>
</tr>
<tr>
<td>์๋ฐ</td>
<td>์๋</td>
<td>์ฒด๋ฆฌ</td>
</tr>
<tr id="last">
<td style="vertical-align: bottom">ํค์</td>
<td style="vertical-align: bottom">์ค๋ ์ง</td>
<td style="vertical-align: bottom">์ฐธ์ธ</td>
</tr>
</table>
</body>
</html>
'Web > ๐งฉ html + CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์ ๋ ฌ Tip (0) | 2020.11.03 |
---|---|
๋ฐ์ค ๋ชจ๋ธ (0) | 2020.11.03 |
ํฌ๊ธฐ (0) | 2020.11.03 |
background ์์ฑ (0) | 2020.11.03 |
font ์์ฑ (0) | 2020.11.03 |