是否可以將一些行和內容添加到實際構建在變量中的表中?用jquery添加一行到構建在變量中的表格
樣品:
//This is the variable i'm talking about
var table = "<table><tr><td>some content</td></tr></table>";
//What i want to do is some like this
$(table).append("<tr><td>some more content</td></tr>");
$("body").append(table);
所以輸出應該是這樣的:
<table>
<tr>
<td>some content</td>
</tr>
<tr>
<td>some more content</td>
</tr>
</table>
但我samle上面似乎並不工作。
是否可以這樣做?
我知道我可以先添加表並添加列,但這不是任務。
東西可以如此簡單^^ – Dwza 2015-03-31 10:52:05