본문 바로가기
css trick & base

테이블 가로 자동 스크롤

by uni:D 2024. 9. 24.
반응형
.table-responsive {width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;}

.table { border-collapse: collapse; width: 100%;tablelayout:auto 기본상태

.table th {padding: 5px 10px;}

 

글자긴거 기준으로 칸간격이 넓어짐 (한줄한줄한줄) 

띄어쓰기 있으면 붙여쓴거 기준!!! (한줄 한줄 한줄)

 

#1.

tablelayout:auto (디폴트값 따로 설정하지않음)글자가 가지고 있는 넓이만큼

(테이블 위드값을 따로주지않고 안에 알맹이 넒이만큼)

 

넓이를 줄려면

min-width: 100px;

max-width: 100px;

width: 100px;적용안됨

 

https://stackoverflow.com/questions/14345194/fixed-width-column-in-html-table-with-table-layout-auto

 

Fixed width column in HTML table with table-layout=auto

When an HTML table has it's table-layout set to auto its columns are auto-sized. Given this scenario is there a way to keep specific columns fixed width? I've tried using CSS width - doesn't seem t...

stackoverflow.com

 

 

#2.

 tablelayout:fixed 넓이를 각각 줄수있다  (링크주소 띄어쓰기없이 들어가는경우  밖으로넘어감)세트: word-break: break-all;

 

----------------------

  1. word-break: keep-all; (단어단위로 띄어쓰기로 떨어진다) => 링크주소가 들어가는경우 부적합
  2. word-break: break-all; (글자 한개 한개 띄어쓰기 상관없이)
  3. word-break: break-all  와  overflow-wrap: break-work   (링크주소 어색하지 않게 떨어지게)
  4. word-wrapbreak-word;  

table-layout: fixed;  => 테이블이 가지고있는 영역만큼 (칸이 좁을시 밑으로 글자가 떨어진다)

 

 

반응형

'css trick & base' 카테고리의 다른 글

아이폰 ios 하단 여백 css 설정  (0) 2024.10.01
로컬피씨 모바일로 보기  (1) 2024.09.29
모바일 스크롤  (0) 2024.09.21
아바타 겹치는이미지  (0) 2024.09.10
레이어팝업 하단 고정 스크롤  (0) 2024.09.04