在div的id为TABLE中输出表格,第一个append能够正确实现,
但是第二个append不能实现我想要的效果,
没有将值正确的放入表格中,但是我看不出代码的问题,将代码不使用循环append直接放入第一个中也是正确的。
要怎么样才能达到值都在表格里的效果。
$('#table').append("<table border='1' width='100%'><tr>"
+"<td align='center'>流水号</td>"
+"<td align='center'>消费地</td>"
+"<td align='center'>总金额</td>"
+"<td align='center'>时间</td>");
for(var m=0;m<data.length;m++){
$('#table').append("<tr>");
$('#table').append("<td><a href='#' onclick='alertWin("+data[m].Cno+");'>"+data[m].Cno+"</a></td>");
$('#table').append("<td>"+data[m].Cplace+"</td>");
$('#table').append("<td>"+data[m].Csum+"</td>");
$('#table').append("<td>"+data[m].Ctime+"</td>");
$('#table').append("</tr>");
}
$('#table').append("/<table>");