The accepted answer is good, but it is definitely worth noting that tbody is the node to which you have to add / add, and using the appendTo and prependTo methods is the best solution, since it will work when there is any line number, including zero.
See this answer for a good example: fooobar.com/questions/118121 / ...
Also note that it is good practice to specify the tel yourself, even if there are no rows, in order to avoid the problem that would automatically prevent a person in the DOM if there were no rows in the table.
source share