javascript插入表格行和列

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function createtabletest(){

  var objTable = document.getElementById("table1");
  var objTR = objTable.insertRow(); 
  var objTD=  objTR.insertCell();
  objTD.innerHTML='增加';


 ////////////////////////////////////////////////
 
 for(var i=0;i<objTable.rows.length;i++)
 {

   var objTD=     objTable.rows[i].insertCell(0);
   objTD.innerHTML=i;
    
 }
 ////////////////////////////////////////////////

}
//-->
</SCRIPT>
<BODY>
<TABLE id="table1">
 
</TABLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
createtabletest();
//-->
</SCRIPT>
</BODY>
</HTML>

 

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=531094

 

你可能感兴趣的:(JavaScript,html,.net,Blog)