HTML 테이블 colspan, rowspan

1 개요[ | ]

HTML td colspan, rowspan attribute
HTML 테이블 colspan, rowspan
HTML td colspan, rowspan 속성
  • HTML 테이블의 셀 병합 속성

2 예시 1[ | ]

<style>  
table { border-collapse:collapse; }  
th, td { border:1px solid black; }
</style>
<table>
	<tr>
		<th>분류</th>
		<th>항목</th>
	</tr>
	<tr>
		<td rowspan='3'>과일</td>
		<td>사과</td>
	</tr>
	<tr>
		<td>바나나</td>
	</tr>
	<tr>
		<td>파인애플</td>
	</tr>
	<tr>
		<td rowspan='2'>채소</td>
		<td></td>
	</tr>
	<tr>
		<td>배추</td>
	</tr>
</table>

3 예시 2[ | ]

<style>  
table { border-collapse:collapse; }  
th, td { border:1px solid black; }
</style>
<table>
	<tr>
		<th rowspan='2'>구분</th>
		<th colspan='3'>내행성</th>
		<th colspan='5'>외행성</th>
	</tr>
	<tr>
		<th>수성</th>
		<th>금성</th>
		<th>지구</th>
		<th>화성</th>
		<th>목성</th>
		<th>토성</th>
		<th>천왕성</th>
		<th>해왕성</th>
	<tr>
		<th>지름비</th>
		<td>0.383</td>
		<td>0.949</td>
		<td>1.000</td>
		<td>0.532</td>
		<td>11.209</td>
		<td>9.449</td>
		<td>4.007</td>
		<td>3.883</td>
	</tr>
</table>

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}