[HTML+CSS] [ν μ€νΈ κ΄λ ¨ νκ·Έ] 04 - νλ₯Ό λ§λλ νκ·Έ
[HTML+CSS] [ν μ€νΈ κ΄λ ¨ νκ·Έ] 03 - λͺ©λ‘μ λ§λλ νκ·Έ
[HTML+CSS] [ν μ€νΈ κ΄λ ¨ νκ·Έ] 02 - μΈλΌμΈ λ 벨 νκ·Έ [HTML+CSS] [ν μ€νΈ κ΄λ ¨ νκ·Έ] 01 - λΈλ‘ λ 벨 νκ·Έ [HTML+CSS] [HTML κΈ°λ³Έ λ€μ§κΈ°] 05 - μν°ν° κΈ°νΈ μ¬μ©νκΈ° [HTML+CSS] [HTML κΈ°λ³Έ λ€μ§κΈ°] 04 - HTML..
onelight-stay.tistory.com
λ΄μ©μ κΉλνκ² νμν μ μλ
νλ₯Ό λ§λλ νκ·Έμ λν΄μ μμ보μ.
<table>, <tr>, <td>, <th> - κΈ°λ³Έμ μΈ ν
<table>μ ν μ΄λΈ μ 체 μ€κ³½μ μ‘μμ£Όκ³
μ΄ μμμ νμ λ§λλ <tr>κ³Ό μ΄μ λ§λλ <td>λ‘ κ΅¬μ±λμ΄ μλ€.
λν <th>λ <td>λμ μ μ¬μ©ν μ μλλ° μ μ μ λͺ©μ λ£μ λ μ¬μ©λλ©°
<td>μλ λ¬λ¦¬ μ μμ λ΄μ©μ μ€μμΌλ‘ λ°°μΉμν€κ³ κΈκΌ΄μ κ΅΅κ² λ§λ€μ΄ μ€λ€.
- colspan, rowspan μμ± -
<table> νκ·Έμμμ <th>μμ μ¬μ© ν μ μλ μμ±μΌλ‘
κ°μ μ΄κ³Ό νμ ν©μΉ μ μλ μμ±μ΄λ€.
-aria-describedby μμ± –
νμ μ΄ν΄λ₯Ό λμ΄κΈ° μν΄ μ€λͺ λ¬Έμ μμ±νκ³ μΆμ λ μ¬μ©λλ©°,
ν μ΄λΈ νκ·Έ λ°μμ idλ₯Ό λ§λ€μ΄ λ΄μ©μ μμ±ν λ€μ
ν μ΄λΈ νκ·Έ μμ ν΄λΉ μμ±μ μ΄μ©ν΄ μ μ λ§λ idμ μ°κ²° μν€λ©΄ λ΄μ©μ΄ μ°κ²°λμ΄
νμ ν¨κ» νλ©΄μ λνλλ€.
<caption>, <figcaption> - νμ μ λͺ© λΆμ΄κΈ°
<caption>μ <figcaption> λλ€ νμ μ λͺ©μ λΆμ΄λλ°μ μ¬μ©λμ§λ§ κ°μ μ°¨μ΄μ μ΄ μλ€.
<caption>μ μ¬μ©ν λ <table><table> νκ·Έ λ°λ‘ λ€μμ μ¬μ©ν΄μΌ νλ©°,
μ¬μ©νμ κ²½μ° ν μμ μ€μμ μ λͺ©μ΄ λνλλ€.
<figcaption>μ μ€λͺ κΈμ λΆμ΄κ³ μΆμ λμμ <figure>λ‘ κ°μΌ λ€μ
<figcaption> μμ.
μ΄λ, <table> νκ·Έ λ°μ μ¬μ©ν΄μΌ νλ©° μ¬μ©νμ κ²½μ°
<caption>κ³Όλ λ¬λ¦¬ μ€μμ λ΄μ©μ΄ λνλμ§ μλλ€.
<thead>, <tbody>, <tfoot> - ν ꡬ쑰 μ μ
νλ₯Ό μ λͺ©(head), λ³Έλ¬Έ(body), μμ½(foot) λΆλΆμΌλ‘
νμ ꡬ쑰λ₯Ό μ μν΄μ νλ₯Ό μμ±νλ κ²μ΄λ€.
ν΄λΉ νλ₯Ό μ μνμμ κ²½μ° μκ°μ₯μ μΈλ€λ νλ©΄ λλ κΈ°λ₯Ό ν΅ν΄ νμ ꡬ쑰λ₯Ό μ½κ² μ΄ν΄ν μ μλ€.
<col>, <colgroup> - μ¬λ¬ μ΄ λ¬Άμ΄ μ€νμΌ μ§μ
<col>μ ν μ΄μ μλ λͺ¨λ μ μ κ°μ μ€νμΌμ μ μ©μν€λ κ²μΌλ‘ λ«λ νκ·Έκ° μμΌλ©°
λν, span μμ±μ μ΄μ©ν΄ λ μ΄μμ μ΄μ λ¬Άμ΄ κ°μ μ€νμΌλ‘ μ§μ ν΄ μ€ μ μλ€.
<colgroup>μ μ¬λ¬ μ΄μ λ¬Άμ΄ μ€νμΌμ μ μ©νλ λ° μ¬μ©λλ€.
ν΄λΉ νκ·Έλ€μ <caption><caption> νκ·Έ λ€ <tr>,<td> νκ·Έ μ μ μ¬μ©ν΄μΌ νλ€.
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>νλ₯Ό λ§λλ νκ·Έ</title>
<style>
table {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
}
thead, tfoot {
background-color: lightgray;
}
</style>
</head>
<body>
<h1>2*3ν λ§λ€κΈ°</h1>
<table>
<tr>
<th>μ λͺ© μ
</th>
<td>1ν 2μ΄</td>
<td>1ν 3μ΄</td>
</tr>
<tr>
<th>μ λͺ© μ
</th>
<td>2ν 2μ΄</td>
<td>2ν 3μ΄</td>
</tr>
</table>
<br>
<hr>
<h1>μΌλΆ μ
ν©μΉκΈ°</h1>
<table>
<tr>
<th>μ΄λ¦</th>
<td>νκΈΈλ</td>
<th>μ°λ½μ²</th>
<td>010-1234-5678</td>
</tr>
<tr>
<th>μ£Όμ</th>
<td colspan="3">νμ</td>
</tr>
<tr>
<th>μκΈ°μκ°</th>
<td colspan="3">λν΄λ²μ©! μν΄λ²μ©!</td>
</tr>
</table>
<br>
<hr>
<h1>νμ μ λͺ© λΆμ΄κΈ°1</h1>
<table>
<caption>
<strong>Modern Browser</strong><br>
<p>κ΅λ΄μμ μμ£Ό μ¬μ©νλ λͺ¨λ λΈλΌμ°μ </p>
</caption>
<tr>
<th>λΈλΌμ°μ </th>
<th>μ μ‘°μ
체</th>
<th>λ€μ΄λ‘λ</th>
</tr>
<tr>
<td>ν¬λ‘¬(Chrome)</td>
<td>Google</td>
<td>https://www.google.com/chrome</td>
</tr>
<tr>
<td>νμ΄μ΄νμ€(Firefox)</td>
<td>Mozilla</td>
<td>https://www.mozilla.org/ko/firefox</td>
</tr>
<tr>
<td>μ£μ§(Edge)</td>
<td>Microsoft</td>
<td>https://www.microsoft.com/ko-kr/windows/microsoft-edge</td>
</tr>
</table>
<br>
<hr>
<h1>νμ μ λͺ© λΆμ΄κΈ°2</h1>
<figure>
<figcaption>
<p>κ΅λ΄μμ μμ£Ό μ¬μ©νλ <b>λͺ¨λ λΈλΌμ°μ </b></p>
</figcaption>
<table>
<tr>
<th>λΈλΌμ°μ </th>
<th>μ μ‘°μ
체</th>
<th>λ€μ΄λ‘λ</th>
</tr>
<tr>
<td>ν¬λ‘¬(Chrome)</td>
<td>Google</td>
<td>https://www.google.com/chrome</td>
</tr>
<tr>
<td>νμ΄μ΄νμ€(Firefox)</td>
<td>Mozilla</td>
<td>https://www.mozilla.org/ko/firefox</td>
</tr>
<tr>
<td>μ£μ§(Edge)</td>
<td>Microsoft</td>
<td>https://www.microsoft.com/ko-kr/windows/microsoft-edge</td>
</tr>
</table>
</figure>
<br>
<hr>
<h1>νλ©΄ λλ
κΈ°λ₯Ό μν ν μ€λͺ
μ 곡νκΈ°</h1>
<p id="summary">λ€μ νλ HTML5λ₯Ό μ§μνλ λͺ¨λ λΈλΌμ°μ (Modern Browser)λ₯Ό μ 리ν κ²μ
λλ€.
μ΅μ λ²μ μΌμλ‘ HTML5λ₯Ό μ’ λ λ§μ΄ μ§μνκΈ° λλ¬Έμ μ΅μ λ²μ μ λ€μ΄λ‘λνλ κ²μ΄ μ’μ΅λλ€.</p>
<table aria-describedby="summary">
<tr>
<th>λΈλΌμ°μ </th>
<th>μ μ‘°μ
체</th>
<th>λ€μ΄λ‘λ</th>
</tr>
<tr>
<td>ν¬λ‘¬(Chrome)</td>
<td>Google</td>
<td>https://www.google.com/chrome</td>
</tr>
<tr>
<td>νμ΄μ΄νμ€(Firefox)</td>
<td>Mozilla</td>
<td>https://www.mozilla.org/ko/firefox</td>
</tr>
<tr>
<td>μ£μ§(Edge)</td>
<td>Microsoft</td>
<td>https://www.microsoft.com/ko-kr/windows/microsoft-edge</td>
</tr>
</table>
<br>
<hr>
<h1>ν ꡬ쑰ννκΈ°</h1>
<table>
<caption>μ μ£ΌνΉλ³μμΉλ νκ΅νν©(2015.4.1 κΈ°μ€)</caption>
<thead>
<tr>
<th>ꡬ λΆ</th>
<th>ν κ΅ μ</th>
<th>ν κΈ μ</th>
<th>ν μ μ</th>
<th>κ΅ μ μ</th>
</tr>
</thead>
<tbody>
<tr>
<th>μ μΉμ</th>
<td>117</td>
<td>252</td>
<td>5,547</td>
<td>474</td>
</tr>
<tr>
<th>μ΄λ±νκ΅</th>
<td>111</td>
<td>1,720</td>
<td>37,686</td>
<td>2,632</td>
</tr>
<tr>
<th>μ€νκ΅</th>
<td>44</td>
<td>699</td>
<td>21,274</td>
<td>1,412</td>
</tr>
<tr>
<th>κ³ λ±νκ΅</th>
<td>29</td>
<td>676</td>
<td>22,019</td>
<td>1,433</td>
</tr>
<tr>
<th>νΉμνκ΅</th>
<td>3</td>
<td>90</td>
<td>428</td>
<td>160</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>ν©κ³</th>
<td>300</td>
<td>3,437</td>
<td>86,954</td>
<td>6,111</td>
</tr>
</tfoot>
</table>
<br>
<hr>
<h1>νμμ μ΄λΌλ¦¬ λ¬ΆκΈ°</h1>
<table>
<caption>colgroup μ°μ΅</caption>
<colgroup>
<col>
<col span="2" style="background-color:skyblue;">
<col style="background-color: yellow;">
</colgroup>
<tr>
<td>1ν 1μ΄</td>
<td>1ν 2μ΄</td>
<td>1ν 3μ΄</td>
<td>1ν 4μ΄</td>
</tr>
<tr>
<td>2ν 1μ΄</td>
<td>2ν 2μ΄</td>
<td>2ν 3μ΄</td>
<td>2ν 4μ΄</td>
</tr>
</table>
<br>
</body>
</html>
νλ₯Ό λ§λ€κΈ° μν΄ html νμΌμ μ μνλλ°
νκ° μ μ΄ μμ΄ λνλλ κ²°κ³Όκ° λνλμ CSSλ₯Ό μ΄μ§ λ³κ²½ν΄ μ£Όμλ€.
(CSSλ μμ§ λλ λͺ¨λ₯΄λ λ€μμ μμΈν μμ보μ.)
νλ₯Ό μ μνλ νκ·Έκ° μ΄λ κ² λ€μν μ€ λͺ°λλ€.
μ΄μ μΈμ°λ μΌλ§ λ¨μλ€.
< μ°Έκ³ >
Do it! HTML5+CSS3 μΉ νμ€μ μ μ
β» ν΄λΉ κΈμ μ΅λ λͺ©μ μΌλ‘ μμ±λ κΈμ λλ€ β»