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

[attribute] HTML - span 속성 ★ - 테이블 (열/열그룹) 병합 개수 지정 (= span속성 = 스팬속성) ※ (콜태그/콜그룹태그) 병합/합치기

목차
  1. span 예제 - <col> 경우
  2. span 정의
  3. span 구문
  4. span 예제 - <colgroup> 경우

 

span 예제 - <col> 경우

 

<style>

table, th, td {border: 1px solid gray; border-collapse:collapse;}

th,td {padding:5px 10px;}

col:nth-child(1) {background-color:pink}

col:nth-child(2) {background-color:yellow}

</style>


<table>

  <colgroup>

    <col span="2">

    <col>

  </colgroup>

  <tr>

    <th>기능</th>

    <th>언어</th>

    <th>게시판</th>

  </tr>

  <tr>

    <td>구조</td>

    <td>HTML</td>

    <td>https://homzzang.com/b/html</td>

  </tr>

  <tr>

    <td>디자인</td>

    <td>CSS</td>

    <td>https://homzzang.com/b/css</td>

  </tr>

</table>

 

결과보기

 

span 정의

 

테이블의 (열:<col> / 열그룹: <colgroup>) 요소의 병합 개수 지정.

 


 

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

<col>, <colgroup>

 

2.

<colgroup> 내의 열에 다른 속성을 정의하려면, <colgroup> 태그 내에서 <col> 태그를 사용.

 

3.

모든 브라우저 지원.

 

 

span 구문

 

  • <col span="number">
  • <colgroup span="number">...</colgroup>

 


[속성값]

 

number

병합합 개수 지정.

 

 

span 예제 - <colgroup> 경우

 

<style>

table, th, td {border: 1px solid gray; border-collapse:collapse;}

th,td {padding:5px 10px;}

colgroup:nth-child(1) {background-color:pink}

colgroup:nth-child(2) {background-color:yellow}

</style>


<table>

  <colgroup span="2"></colgroup>

  <colgroup></colgroup>

  <tr>

    <th>기능</th>

    <th>언어</th>

    <th>게시판</th>

  </tr>

  <tr>

    <td>구조</td>

    <td>HTML</td>

    <td>https://homzzang.com/b/html</td>

  </tr>

  <tr>

    <td>디자인</td>

    <td>CSS</td>

    <td>https://homzzang.com/b/css</td>

  </tr>

</table>

 

결과보기



분류 제목
attribute HTML - onplaying 속성 - (오디오/비디오) 재생 중 실행 (= onplaying속성 = 온플레…
attribute HTML - onsubmit 속성 ★ - 폼데이터 제출 시 실행 (= onsubmit속성 = 온서브미트속성/…
attribute HTML - title 속성 ★ - 요소애 대한 추가 정보 지정 (= title속성 = 타이틀속성)
attribute HTML - enctype 속성 - 폼데이터 인코딩방식 지정 (= enctype속성 = 인크타입속성/잉크타입…
attribute HTML - ondragleave 속성 - 드래그 한 요소가 드롭박스 이탈 시 실행 (= ondragleav…
attribute HTML - ononline 속성 - 브라우저가 온라인으로 작동할 때 실행 (= ononline속성 = 온온…
attribute HTML - onseeked 속성 - (오디오/비디오) 재생위치 변경 종료 시, 실행할 코드 지정. (= o…
form HTML - <input type="radio"> 태그 - 오직 1개의 요소만 선택 (= 인풋라디오타입/라디…
attribute HTML - onemptied 속성 - 미디어 소스가 비어있거나 삭제된 경우에 실행 (= onemptied속…
attribute HTML - src 속성 ★ - 외부 리소스 URL주소 지정 (= src속성 = 에스알시속성/에스알씨속성/소…
attribute HTML - cellspacing 속성 - 테이블셀간의 간격 지정 (= cellspacing속성 = 셀스페이…
attribute HTML - onabort 속성 - 미디어 파일 로드 중단 이벤트 발생 시 실행할 코드 정의 (= onabo…
attribute HTML - srclang 속성 - 트랙태그 소스의 언어코드 지정 (= srclang속성 = 에스알시랭속성/…
attribute HTML - onpageshow 속성 - 사용자가 웹페이지 탐색 시 실행 (= onpageshow속성 = 온…
attribute HTML - form 속성 - 해당 요소가 속하는 폼요소 지정 (= form속성 = 폼속성) ※ 폼 밖에 위…
form HTML - <input type="hidden"> 태그 - 숨겨진 입력 필드 지정 (= 사용자 몰래 입력값…
attribute HTML - label 속성 - 요소에 대한 꼬리표 지정 (= label속성 = 레이블속성/라벨속성)
attribute HTML - headers 속성 - 관련된 헤더셀ID 목록 지정 (= headers속성 = 헤더스속성/헤더즈…
attribute HTML - onstalled 속성 - (오디오/비디오) 이용불가 (=사용불가) 시 실행 (= onstall…
form HTML - <input type="number"> 태그 - 숫자 입력 (= 인풋넘버타이/넘버타입인풋/넘버인…
2/18
목록
찾아주셔서 감사합니다. Since 2012