我使用這個動態添加行到表:沒有行動態添加行HTML表
$('#myTable tr:last').after('<tr><td>1</td><td>a</td></tr>');
,但它似乎並沒有工作,如果表沒有記錄:
<table id="myTable" class="altTable">
<thead>
<tr>
<th>
Col1
</th>
<th>
Col2
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
什麼是正確的選擇器在這裏添加一個行,如果有0行或> 0行存在?
你要添加的行結束TBODY嗎? – rahul 2009-12-23 13:40:54
是的。 。 。 。 。 。 。 – leora 2009-12-23 14:58:32