<caption>: í ì¤ëª ìì
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 7ì.
* Some parts of this feature may have varying levels of support.
HTML <caption> ììë íì ì¤ëª
ëë ì 목ì ëíë
ëë¤.
ìëí´ ë³´ê¸°
<table>
<caption>
He-Man and Skeletor facts
</caption>
<tr>
<td></td>
<th scope="col" class="heman">He-Man</th>
<th scope="col" class="skeletor">Skeletor</th>
</tr>
<tr>
<th scope="row">Role</th>
<td>Hero</td>
<td>Villain</td>
</tr>
<tr>
<th scope="row">Weapon</th>
<td>Power Sword</td>
<td>Havoc Staff</td>
</tr>
<tr>
<th scope="row">Dark secret</th>
<td>Expert florist</td>
<td>Cries at romcoms</td>
</tr>
</table>
caption {
caption-side: bottom;
padding: 10px;
font-weight: bold;
}
table {
border-collapse: collapse;
border: 2px solid rgb(140 140 140);
font-family: sans-serif;
font-size: 0.8rem;
letter-spacing: 1px;
}
th,
td {
border: 1px solid rgb(160 160 160);
padding: 8px 10px;
}
th {
background-color: rgb(230 230 230);
}
td {
text-align: center;
}
tr:nth-child(even) td {
background-color: rgb(250 250 250);
}
tr:nth-child(odd) td {
background-color: rgb(240 240 240);
}
.heman {
font: 1.4rem molot;
text-shadow:
1px 1px 1px #fff,
2px 2px 1px #000;
}
.skeletor {
font: 1.7rem rapscallion;
letter-spacing: 3px;
text-shadow:
1px 1px 0 #fff,
0 0 9px #000;
}
| ì½í ì¸ ì¹´í ê³ ë¦¬ | ìì |
|---|---|
| ê°ë¥í ì½í ì¸ | íë¡ì° ì½í ì¸ . |
| íê·¸ ìëµ | ë°ë¡ ë¤ì ì¤íì´ì¤ë 주ìì´ ì¤ì§ ìì¼ë©´ ë«ë í그를 ìëµí ì ììµëë¤. |
| ê°ë¥í ë¶ëª¨ ìì | <table> ìì. 첫 ë²ì§¸ ììì´ì´ì¼ í©ëë¤. |
| ê°ë¥í ARIA ìí | ìì |
| DOM ì¸í°íì´ì¤ | HTMLTableCaptionElement |
í¹ì±
ì´ ììë ì ì í¹ì±ë§ í¬í¨í©ëë¤.
Deprecated attributes
The following attributes are deprecated and should not be used. They are documented below for reference when updating existing code and for historical interest only.
align-
This enumerated attribute indicates how the caption must be aligned with respect to the table. It may have one of the following values:
left-
The caption is displayed to the left of the table.
top-
The caption is displayed above the table.
right-
The caption is displayed to the right of the table.
bottom-
The caption is displayed below the table.
ê²½ê³ : Do not use this attribute, as it has been deprecated. The
<caption>element should be styled using the CSS propertiescaption-sideandtext-align.
ì¬ì© ì¼ë
<caption> ììë ë¶ëª¨ <table> ììì 첫 ë²ì§¸ ììì´ì´ì¼ í©ëë¤.
<caption> ìì를 ê°ì§ <table> ììê° ë§ì½ <figure> ììì ì ì¼í ììì¸ ê²½ì°, <figcaption>ì ëì ì¬ì©íì¸ì.
ìì
ë¤ìì ê°ë¨í ìì ë ì¤ëª ì í¬í¨í í를 ë³´ì ëë¤.
<table>
<caption>
Example Caption
</caption>
<tr>
<th>Login</th>
<th>Email</th>
</tr>
<tr>
<td>user1</td>
<td>user1@sample.com</td>
</tr>
<tr>
<td>user2</td>
<td>user2@sample.com</td>
</tr>
</table>
ëª ì¸
| Specification |
|---|
| HTML > # the-caption-element > |