HTML

[attribute] HTML - scope 속성 - <th> (테이블헤더셀)의 범위 지정 (= scope속성 = 스코우프속성/스코프속성) ※ 티에이치태그의 범위 지정

목차
  1. scope 예제 - 헤더 범위 지정
  2. scope 정의
  3. scope 구문
  4. scope 예제 - (행/열) 헤더셀 둘 다 적용

 

scope 예제 - 헤더 범위 지정

 

<style>

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

</style>


<table>

  <tr>

    <th>번호</th>

    <th scope="col">언어</th>

    <th scope="col">기능</th>

  </tr>

  <tr>

    <td>1</td>

    <td>HTML</td>

    <td>구조</td>

  </tr>

  <tr>

    <td>2</td>

    <td>CSS</td>

    <td>디자인</td>

  </tr>

</table>

 

결과보기

 

scope 정의

 

해당 테이블헤더셀(<th>)의 범위 지정.

 


 

1. scope 속성 사용 가능 태그 종류

<th>

 

2.

scope 속성 사용 시 브라우저 표시엔 영향 안 미침.

다만, 사용 시, 스크린리더기 등 웹접근성에 도움됨.

 

3.

모든 브라우저 지원.

 

 

scope 구문

 

<th scope="col|row|colgroup|rowgroup">...</th>

 


[속성값]

 

  • col - 컬럼 (=세로열=세로줄)의 헤더임을 지정.
  • row - 로우 (= 가로행=가로줄)의 헤더임을 지정.
  • colgroup - 컬럼그룹(=컬럼묶음)의 헤더임을 지정.
  • rowgroup - 로우그룹 (= 로우묶음)의 헤더임을 지정.

 

 

scope 예제 - (행/열) 헤더셀 둘 다 적용

 

<style>

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

</style>


<table>

  <caption>코딩언어 소개</caption>

  <thead>

    <tr>

      <th scope="col">기능</th>

      <th scope="col">언어</th>

    </tr>

  </thead>

  <tbody>

    <tr>

      <th scope="row">구조</th>

      <td>HTML</td>

    </tr>

    <tr>

      <th scope="row">디자인</th>

      <td>CSS</td>

    </tr>

    <tr>

      <th scope="row">기능</th>

      <td>JS</td>

    </tr>

  </tbody>

</table>


결과보기



분류 제목
attribute HTML - onmouseup 속성 - 마우스버튼 올라갈 때 실행 (= onmouseup속성 = 온마우스업속…
attribute HTML - onmousewheel 속성 - (폐기예고) 마우스휠 움직일 때 실행 (= onmousewhe…
attribute HTML - onoffline 속성 - 브라우저가 오프라인으로 작동할 때 실행 (= onoffline속성 =…
attribute HTML - ononline 속성 - 브라우저가 온라인으로 작동할 때 실행 (= ononline속성 = 온온…
attribute HTML - onpagehide 속성 - 웹페이지가 숨겨질 때 실행 (= onpagehide속성 = 온페이지…
attribute HTML - onpageshow 속성 - 사용자가 웹페이지 탐색 시 실행 (= onpageshow속성 = 온…
attribute HTML - onpaste 속성 - 사용자가 요소에 내용 붙여넣기 시 실행 (= onpaste속성 = 온패스…
attribute HTML - onpause 속성 - (오디오/비디오) 일시정지 시 실행 (= onpause속성 = 온포스속성…
attribute HTML - onplay 속성 - (오디오/비디오) 재생 시 실행 (= onplay속성 = 온플레이속성) ※…
attribute HTML - onplaying 속성 - (오디오/비디오) 재생 중 실행 (= onplaying속성 = 온플레…
attribute HTML - onpopstate 속성 - 브라우저 히스토리 변경 시 실행 (= onpopstate속성 = 온…
attribute HTML - onprogress 속성 - (오디오/비디오) 다운로드 시 실행 (= onprogress속성 =…
attribute HTML - onratechange 속성 - (오디오/비디오) 재생속도 변경 시 실행 (= onratecha…
attribute HTML - onreset 속성 - 폼 초기화 시 실행 (= onreset속성 = 온리셋속성) ※ onres…
attribute HTML - onresize 속성 ★ - 브라우저창크기 변경 시 실행 (= onresize속성 = 온리사이즈…
8/12
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티 2
웹유틸
회원센터
홈짱닷컴 PC버전 로그인