给表单第一列添加序号(此方法可以放到公共js文件中,多个页面引用该js,复用)
表单空出第一列,查询完成后调用此方法即可。
[img]http://dl2.iteye.com/upload/attachment/0109/4305/65a71f43-22e5-3700-bbe9-8f625db6466e.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0109/4309/57e00787-afb3-31d2-a7d7-2992573a0fb9.png[/img]
表单空出第一列,查询完成后调用此方法即可。
function addTableNo(){
//$('table tr:not(:first)').remove();
var len = $('table tr').length;
for(var i = 1;i<len;i++){
$('table tr:eq('+i+') td:first').text(i);
}
}
[img]http://dl2.iteye.com/upload/attachment/0109/4305/65a71f43-22e5-3700-bbe9-8f625db6466e.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0109/4309/57e00787-afb3-31d2-a7d7-2992573a0fb9.png[/img]