请问在增加列时 怎么才能够增加复选框 和前3个一样 怎么判断呢<script language="javascript" type="text/javascript">
 function   InsertCol(obj){   //插入列
  var   oTd   
  for(j=0;j<obj.rows.length;j++){     
  oTd=obj.rows(j).insertCell(obj.rows(j).cells.length);   
  alert(obj.rows(j).cells(0));
  oTd.innerHTML='<input type="text" />';
  }   
  }   
  
  function   DeleteCol(obj){   //删除列 
  for(j=0;j<obj.rows.length;j++)   
  {   
  if(obj.rows(j).cells.length>4)   
  {   
  obj.rows(j).deleteCell(obj.rows(j).cells.length-1);   
  }   
  }   
  }  
</script>
<td align="right"><input name="addv_btn" id="addv_btn" type="button" class="button" onClick="InsertCol(delegateInfor3);"  value="增加列" /> 
<input name="del_btn" id="del_btn" type="button" class="button" onClick="DeleteCol(delegateInfor3)" value="删除行" />  <TABLE id="delegateInfor3"  width="100%"
border="1" align="center" cellpadding="0" cellspacing="0"
bordercolor="#CCCCCC">
<tr>
<td width="100" height="20" align="center"> </td>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
</tr>
<tr>
<td width="100" height="20" align="center">序号 </td>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">评级类型 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">评级公司 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">级别 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">编号 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
</table>

解决方案 »

  1.   

    你先取的你增加的前一列的td 的 innerHtml  , 然后赋给 新增加的这列不就可以了吗 
      

  2.   

    oTd.innerHTML=obj.rows(j).cells(1).innerHTML;
      

  3.   

    插入列的方法改成下面的代码function   InsertCol(obj){   //插入列
      var   oTd   
      for(j=0;j<obj.rows.length;j++){     
      oTd=obj.rows(j).insertCell(obj.rows(j).cells.length);   
      alert(obj.rows(j).cells(0));
      if(j==0)
      {
       oTd.innerHTML=obj.rows(0).cells(1).innerHTML;
      }else
      {
       oTd.innerHTML='<input type="text" />';
      }

      }   
    }