var len = $('table tr').length; for(var i = 1;i<len;i++){ $('table tr:eq('+i+') td:first').text(i); }
删除按钮和添加按钮加上事件定义的function就可以了