SW개발/HTML, CSS

테이블이 화면 100% 설정임에도 넘어가는 현상

개소왕 2019. 5. 23. 09:28

 

;; 안 1 

https://stackoverflow.com/questions/14767459/why-td-width-is-not-working-or-not-followed

td 에 

display : inline-block

적용

 

하면 셀이 table 을 맞추지 못하고 오히려 작아져 버림

(inline 이니까 table 과 따로 놀겠지..

 

;; 안 2 

position : relative

 

전혀 반응 없음.

 

 

;; 안 3 - 해결

table-layout : fixed 로 해결됨.

표가 100%이상 크기 => 100% 로 고정 되면서

셀 안의 글자가 삐져나가는 문제가 발생하는데, 

 

이건 

text-overflow: ellipsis;

white-space: nowrap

 

로 해결

https://stackoverflow.com/questions/9789723/css-text-overflow-in-a-table-cell