我正在构建一个Jquery移动应用程序,因为我创建了一个表,我需要从DB更新该表行。
这是我的HTML ...
<table style="width:100%;" id="cart_table">
<tr>
<th>Item</th>
<th>Qty</th>
<th>Price</th>
<th>Delete</th>
</tr> </table>
我调用showall()方法,在点击购物车按钮时显示其中的所有购物车商品。
var row = ('<tr><td align="center"><a>'+cartitem1+'</a></td> <td align="center"><a>'+cart_qty+'</a></td> <td align="center"><a>'+cart_price+'</a></td><td align="center"><a><img src=""/></a></td></tr>');
$("#cart_table").html(row.html());
这将是for循环。我已经为样本放了一行.. 帮助我动态更新我的行
答案 0 :(得分:0)
我已更改此行
$("#cart_table").html(row.html());
到
$('#cart_table tr:last').after(row);
它有效..