jquery实现table tr td重组排序号

阅读 57

2022-07-27


//自动重组排序号
function RowIndexInitialize(obj) {
var index = 1;
obj.children("tr:gt(1):not(:last-child)").each(function(i) {
$(this).find("td:eq(0)").html(index++);
});
}

//自动重组排序号使用演示
RowIndexInitialize($(".tbBomItem tbody:first"));

改前:

Row

1

2

4

5

7

8

改后:

Row

1

2

3

4

6

7



精彩评论(0)

0 0 举报