insert row 테이블에 row 추가하기

   
   
  삽입
   
  삽입
   
  삽입

 

<script type="text/javascript">
var i_num=0;
function table_insert_row(this_s){
parent_td = this_s.parentNode;
parent_tr = parent_td.parentNode;
parent_table = parent_tr.parentNode;
clone_tr = parent_tr.cloneNode(true);

if (parent_tr.nextSibling)
parent_tr.parentNode.insertBefore(clone_tr,parent_tr.nextSibling);
else parent_tr.parentNode.appendChild(clone_tr);

//parent_table.appendChild(clone_tr)
}
</script>
<table width="100"  border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr bgcolor="#993300">
    <td>&nbsp;</td>
    <td> <span onClick="table_insert_row(this);">삽입</span></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td bgcolor="#0066CC"> <span onClick="table_insert_row(this);">삽입</span></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#99CC33">&nbsp;</td>
    <td> <span onClick="table_insert_row(this);">삽입</span></td>
  </tr>
</table>

댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -