2012-01-11 19 views

回答

2

要什麼做的是每行添加一個單元格,對嗎?如果是這樣的話:

的Prototype.js:

$$("tr").each(function(tr){ 
    $(tr).insert('<td>Content of the new cell</td>') 
}) 

的jQuery:

$("tr").append("<td>Content of the new cell</td>") 
+0

爲什麼在函數包裝了'.append'打電話? – zetlen 2012-07-08 22:50:07

+0

沒有理由,我只是複製相同的例子,並忘記了在jQuery中可以使用一個字符串作爲append方法 – 2012-07-08 23:49:51

相關問題