-1

What I need to know is how to insert a row into a tbody with specific column,for example I need to insert after the second row . I know I can do it with jquery ,but it does not suit in IE

I have tried it with jquery but I got an error '"对象不支持“after”属性或方法"'

var tr1 = tbody.getElementsByTagName('tr')[1];
var newRow = tbody.insertRow()
tr1.after(newRow)

I expect I can get a row after the second row .

qihuan wu
  • 47
  • 7

1 Answers1

0

Here is the answer .

tbody.insertRow(2)
qihuan wu
  • 47
  • 7
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/22234401) – Sree Feb 18 '19 at 07:38
  • When I asked this question ,I do not know the answer。But a soon later I found the answer in w3cschool. – qihuan wu Feb 19 '19 at 00:44
  • I can see that you had posted the solution for your above question. I suggest you to mark your own answer as an accepted answer after 24 hrs, when it is available to mark it. It can help other community members in future in similar kind of issues. Thanks for your understanding. – Deepak-MSFT Feb 19 '19 at 07:20