這是邏輯: 我輸入了一些內容,表單是AJAX實時搜索。在找到值之後,我點擊添加按鈕,並在現有表/ tbody中創建新行。AJAX:向表添加新行或使用AJAX刪除
<table class="standard">
<thead>
<tr>
<td colspan="2">
Start Input barcode/Product Name
</td>
<td colspan="4">
<input type="text" size="90" value="" placeholder="Barcode/Product Name">
</td>
<td>
<button class="tambah"><i class="icon-plus"></i> Add</button>
</td>
</tr>
<tr>
<td>
No.
</td>
<td>
Kode Barang
</td>
<td>
Nama Barang
</td>
<td>
Qty
</td>
<td>
Harga
</td>
<td>
Disc %
</td>
<td>
Total
</td>
</tr>
</thead>
<tbody>
<!-- when button add is click that will add <tr></tr> here -->
</tbody>
</table>
我可以這樣做嗎?如果是這樣,怎麼樣?
小提琴例:http://jsfiddle.net/anggagewor/cauPH/
你可以創建一個小提琴嗎?這個問題並不清楚。 –
@GurminderSingh sory,下次我會在小提琴上發表演示。 – Anggagewor
順便說一下,[這裏](http://stackoverflow.com/questions/15103661/dynamically-add-and-remove-table-rows?rq=1)是類似的問題給你的。 –