[Javascript] - Auto Td Row span

Javascript 2011. 7. 7. 09:49
반응형

 

예제 입니다.

<html>
<head>
<script language='javascript' src='./rowspan.js'></script>
<script language='javascript'> function init()
 {
  cellMergeChk(document.getElementById("dataList"), 1, 0);  //첫번째 td 처리
//  cellMergeChk(document.all.dataList, 1, 1);  //두번째 td 처리
 }
</script>
</head>
<body onload='init()'>
<table id='dataList' border='1'>
<tr>
 <td>학년</td>
 <td>반</td>
 <td>이름</td>
</tr>
<tr>
 <td>1</td>
 <td>1</td>
 <td>사람1</td>
</tr>
<tr> 
 <td>1</td>
 <td>2</td>
 <td>저사람2</td>
</tr>
<tr> 
 <td>1</td>
 <td>2</td>
 <td>저사람2</td>
</tr>
<tr> 
 <td>2</td>
 <td>1</td>
 <td>저사람3</td>
</tr>
<tr> 
 <td>2</td>
 <td>2</td>
 <td>저사람4</td>
</tr>
<tr>
 <td>1</td>
 <td>1</td>
 <td>사람1</td>
</tr>
<tr> 
 <td>1</td>
 <td>2</td>
 <td>저사람2</td>
</tr>
<tr> 
 <td>1</td>
 <td>2</td>
 <td>저사람2</td>
</tr>
<tr> 
 <td>2</td>
 <td>1</td>
 <td>저사람3</td>
</tr>
<tr> 
 <td>2</td>
 <td>2</td>
 <td>저사람4</td>
</tr>
</table>
</body>
</html>

 

반응형
: