<br>//Constructor<br>function InsterCell(tableId,content,place){<br>this.mTableId=tableId;//Identity of table<br>this.mInsContent =content;//The content of inster<br>this.mInsPlace=place;//The position of inster<br>this.cInsCell=InsCell;<br>this.cClearCell=ClearCell;<br>}<br>//Insert <br>function InsCell(){<br>str=eval(this.mTableId+".cells["+this.mInsPlace+"]");//Writing this like this doesn’t work either! <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='</tr></table>';<br>this.mInsPlace++;<br>}<br>//clear <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>Original balance of Bank of Communications</TD>';<br>str+='<TD><input type="text " name="earning"></TD>';<br>str+='<TD><input type="text" name="payout"></TD>';<br> str+='<TD><input type="text" name="cashOnHand"> </TD>'; <br>str+='<TD><input type="text" name=" cashOnHandRemark"></TD>';<br>var ins=new InsterCell("t1","str",1);<br>ins.cInsCell();<br>Code:-------------------------------------------------- ---------------------------------- Invoice<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> <p align="left"></p> <div style="display:none;"> <span id="url" itemprop="url">http://www.bkjia.com/PHPjc/629494.html</span><span id="indexUrl" itemprop="indexUrl">www.bkjia.com</span><span id="isOriginal" itemprop="isOriginal">true</span><span id="isBasedOnUrl" itemprop="isBasedOnUrl">http: //www.bkjia.com/PHPjc/629494.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description">script language=JavaScript //Constructor function InsterCell(tableId,content,place){ this.mTableId=tableId; //The identifier of table this.mInsContent=content; //The content of inster this.mInsPlac...</span> </div> <div class="art_confoot"></div>