[CSS]colgroup

해내면 그만!XX·2022년 5월 5일
0

colgroup 태그는 사용되는 테이블의 컬럼(td 태그)에 적용할 스타일 width와 bakcground를 해당 태그에서 미리 적용할 수 있게 합니다.
특히 각 컬럼의 길이를 설정하는데 가장 많이 쓰입니다.

<table border="1">
  <colgroup>
    <col width="50px" style="background: red" />
    <col width="200px" style="background: blue" />
    <col width="100px" style="background: green" />
  </colgroup>

  <thead>
    <tr>
      <td>번호</td>
      <td>제목</td>
     <td>이름</td>
    </tr>
  </thead>
</table>
번호 제목 이름

참조
https://webisfree.com/2015-10-31/%ED%85%8C%EC%9D%B4%EB%B8%94-%ED%83%9C%EA%B7%B8-colgroup-%EC%95%8C%EC%95%84%EB%B3%B4%EA%B8%B0

0개의 댓글