<br />//构造函数<br />function InsterCell(tableId,content,place){<br />this.mTableId=tableId;//table的标识<br />this.mInsContent=content;//inster的内容<br />this.mInsPlace=place;//inster的位置<br />this.cInsCell=InsCell;<br />this.cClearCell=ClearCell;<br />}<br />//插入<br />function InsCell(){<br />str=eval(this.mTableId+".cells["+this.mInsPlace+"]");//这个这样写也不行!<br />str.innerHTML='<table cellspacing="0" cellpadding="0" border="0" ><tr>';<br />this.mTableId.cells[this.mInsPlace].innerHTML=this.mInsContent;<br />this.mTableId.cells[this.mInsPlace].innerHTML='';<br />this.mInsPlace++;<br />}<br />//清楚<br />function ClearCell(){<br />for(i=0;i<this.mTableId.cells.length/2-1;i++){<br />this.mTableId.cells[2*i+1].innerHTML="";<br />}<br />}<br />str='<TD>交行原余额';<br />str+='<TD><input type="text" name="earning">';<br />str+='<TD><input type="text" name="payout">';<br />str+='<TD><input type="text" name="cashOnHand"> '; <br />str+='<TD><input type="text" name="cashOnHandRemark">';<br />var ins=new InsterCell("t1","str",1);<br />ins.cInsCell();<br />代码:-------------------------------------------------------------------------------- 发货单 <br />function tbladdrow() <br />{<br /> var i=lines.rows.length ;<br /> var row = Table1.insertRow(Table1.rows.length);<br /> var col = row.insertCell(0);<br /> col.innerHTML = "<INPUT id=line["+i+"][Commcd] name=line["+i+"][Commcd]>";<br /> <p align="left"><div style="display:none;"><span id="url" itemprop="url">http://www.bkjia.com/PHPjc/629494.html<span id="indexUrl" itemprop="indexUrl">www.bkjia.com<span id="isOriginal" itemprop="isOriginal">true<span id="isBasedOnUrl" itemprop="isBasedOnUrl">http://www.bkjia.com/PHPjc/629494.html<span id="genre" itemprop="genre">TechArticle<span id="description" itemprop="description">script language=JavaScript //构造函数 function InsterCell(tableId,content,place){ this.mTableId=tableId;//table的标识 this.mInsContent=content;//inster的内容 this.mInsPlac... <div class="art_confoot">