HTML

[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 - 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버전 로그인