0

JS:

var tab = document.getElementById("tab"); 
var newTr = tab.insertRow(-1);   
newTr.id = "tr_" + trId; 
var newTdContent = newTr.insertCell(1); //  first line
var newTdCaoZuo  = newTr.insertCell(2); //   second line      
// set the data of two line  
newTdContent.innerHTML  = "<textarea rows='5' cols='40'name='getContent' id='getContent'>" + content.value + "</textarea>";  
newTdCaoZuo.innerHTML  = "<input type='button' onclick='moveTr("+trId+")' value='remove'>";

表中的新行与另一行不同。新增线型有限。

table 

<tr class="trd0"> 
<td>..</td> 
<tr> 

我不想添加像 class="trd0" 这样的 newTr 模式。如何实现?</p>

4

0 回答 0