79226903

Date: 2024-11-26 13:33:12
Score: 0.5
Natty:
Report link

My favorite approach works with outerHTML:

var table = document.getElementById("myTable");
var newrow = table.tBodies[0].insertRow();
newrow.outerHTML = "<tr><td>aaaa</td><td>bbb</td></tr>";

This way you can insert complex rows with several cells and within the cells html elements like fields and buttons.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: user2587656