更新时间:2022-12-12 15:34:06
You can use .eq()
and .after()
like this:
$('#my_table > tbody > tr').eq(i-1).after(html);
索引是基于0的,所以要成为第4行,你需要 i-1
,因为 .eq(3)
将是第4行,你需要回到第3行( 2
)并插入 .after()
即。
The indexes are 0 based, so to be the 4th row, you need i-1
, since .eq(3)
would be the 4th row, you need to go back to the 3rd row (2
) and insert .after()
that.