HTML

테이블 비율이 안 맞을 때 (colgroup, th, td)

yes or yes 2020. 9. 17. 11:35
반응형

width비율을 맞춰도 정상적으로 나오지 않을 때가 있다.

그럴 때 테이블 style에 추가해주자!

 


<table style = "table-layout: auto; width: 100%; table-layout: fixed;" >

   <colgroup>
   <col width="33%" />
   <col width="33%" />
   <col width="33%" />

   </colgroup>

 

   <thead>
   <tr>
   <th>비율이</th>
   <th>맞지를</th>
   <th>않아</th>

   </tr>
   </thead>

 

   <tbody>

   <td>퍼센트를</td>

   <td>맞춰서</td>

   <td>줬는데</td>

   </tbody>

</table>

반응형