• 회원가입
  • 로그인
  • 구글아이디로 로그인

[DOM_Style] JS - tableLayout 속성 - 테이블 셀, 행 및 열을 레이아웃 (= table-layout속성 = tableLayout속성 = 테이블레이아웃속성)

tableLayout 예제 - 설정

 

<style> 

table, td {

  border: 1px solid black;

}


#hz {

  width: 100%;

}

</style>


<button onclick="homzzang()">클릭</button>


<table id="hz">

  <tr>

    <td>Homzzang.com</td>

    <td>홈짱닷컴</td>

  </tr>

  <tr>

    <td>sir.kr</td>

    <td>그누보드</td>

  </tr>

  <tr>

    <td>yamette.com</td>

    <td>야메떼닷컴</td>

  </tr>

</table>


<script>

function homzzang() {

  document.getElementById("hz").style.tableLayout = "fixed";

}

</script>

 

결과보기 

 

 

tableLayout 정의 

 

테이블의 (셀, 열, 행) 레이아웃 설정/반환.

 


 

1.

기본값: auto

반환값: table-layout 속성값을 나타내는 문자열

CSS속성: table-layout
CSS버전: CSS2

2.

모든 브라우저 지원. 

 

 

 

tableLayout 구문 

 

[반환]

object.style.tableLayout 

 

[설정]

object.style.tableLayout = "속성값"

 


 

[속성값]

 

auto

열 너비는 깨지지 않는 가장 넓은 내용으로 설정. (기본값)

테이블이 완전히 로드되기 전 모든 내용에 접근할 필요가 있어 가끔 느림.

 

fixed

열 너비는, 셀 내용이 아니라, 테이블 및 열 너비에 의해 결정. 

테이블의 첫 번째 행만 수신하면 바로 테이블 표시 가능. (auto보다 빠름)

 

initial

이 속성의 기본값으로 설정.

 

inherit

부모요소의 속성값 상속.

 


 

tableLayout 예제 - 반환 

 

<style> 

table, td {border: 1px solid black;}

#hz {width: 100%;}

</style>


<table id="hz" style="table-layout:fixed;">

  <tr>

    <td>Homzzang.com</td>

    <td>홈짱닷컴</td>

  </tr>

  <tr>

    <td>sir.kr</td>

    <td>그누보드</td>

  </tr>

  <tr>

    <td>yamette.com</td>

    <td>야메떼닷컴</td>

  </tr>

</table>


<button type="button" onclick="homzzang()">클릭</button>


<script>

function homzzang() {

  alert(document.getElementById("hz").style.tableLayout);

}

</script>


결과보기


분류 제목
Math JS - Math.log1p() 메서드 -
Math JS - Math.expm1() 메서드 -
Math JS - Math.clz32() 메서드 - 32비트 이진수에서 앞에 오는 0 개수 반환 (= Math.clz…
Math JS - Math.fround() 메서드 - 최근접 32비트 단정밀도 부동소수 반환 (= Math.froun…
Math JS - Math.sign() 메서드 - 숫자부호판별 (= Math.sign메서드 = 매스사인메서드) ※ 숫…
js JS - 모든 링크 주소를 특정 URL주소로 일괄 변경
js JS - 화면 리사이즈 시, 스크롤바 가운데로 이동 (= 화면크기 변경 시, 스크롤바 중앙에 위치시키기)
API_Fetch JS - Fetch API (= JavaScript로 파일 내용 가져오기 = fetch메서드=페치메서드)
API_MediaQueryList JS - window.MediaQueryList 객체 - 미디어쿼리 정보 저장 (= window.MediaQ…
Basic JS - 반복문 종류 ( for / for...of / for...in / while / do...while…
DOM_Element JS - remove() 메서드 - 요소 제거 (= remove메서드 = 리무브메서드) ※ 요소제거
Window_Object JS - window.jQuery 속성 - 제이쿼리 라이브러리 로드 여부 확인 (= 윈도우제이쿼리속성)
js JS - 특정 문자열 글자 포함 요소의 글자색 스타일 변경
67/67
목록
찾아주셔서 감사합니다. Since 2012