caption-side
caption-side (표 캡션 위치)
테이블의 캡션(caption) 요소를 표의 위쪽이나 아래쪽에 배치하는 유틸리티예요. 옆에서 함께 짚어 드릴게요.
출처: 문서
본문
ClassStyles
| 클래스 | 스타일 |
|---|---|
caption-top |
caption-side: top; |
caption-bottom |
caption-side: bottom; |
Examples
Placing at top of table
caption-top 유틸리티를 사용해서 캡션 요소를 테이블 위쪽에 배치할 수 있어요.
<table>
<caption class="caption-top">
Table 3.1: Professional wrestlers and their signature moves.
</caption>
<thead>
<tr>
<th>Wrestler</th>
<th>Signature Move(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>"Stone Cold" Steve Austin</td>
<td>Stone Cold Stunner, Lou Thesz Press</td>
</tr>
<tr>
<td>Bret "The Hitman" Hart</td>
<td>The Sharpshooter</td>
</tr>
<tr>
<td>Razor Ramon</td>
<td>Razor's Edge, Fallaway Slam</td>
</tr>
</tbody>
</table>
Placing at bottom of table
caption-bottom 유틸리티를 사용해서 캡션 요소를 테이블 아래쪽에 배치할 수 있어요.
<table>
<caption class="caption-bottom">
Table 3.1: Professional wrestlers and their signature moves.
</caption>
<thead>
<tr>
<th>Wrestler</th>
<th>Signature Move(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>"Stone Cold" Steve Austin</td>
<td>Stone Cold Stunner, Lou Thesz Press</td>
</tr>
<tr>
<td>Bret "The Hitman" Hart</td>
<td>The Sharpshooter</td>
</tr>
<tr>
<td>Razor Ramon</td>
<td>Razor's Edge, Fallaway Slam</td>
</tr>
</tbody>
</table>
Responsive design
caption-side 유틸리티 앞에 md: 같은 브레이크포인트 변형을 붙이면, 중간 크기(md) 화면 이상에서만 해당 유틸리티를 적용할 수 있어요.
<caption class="caption-top md:caption-bottom ...">
<!-- ... -->
</caption>
변형(variant) 사용법에 대해 더 자세히 알고 싶다면 variants 문서를 참고해 주세요.