The HTMLTableRowElement.insertCell()
method inserts a new cell (<td>
) into a table row (<tr>
) and returns a reference to the cell.
Note: insertCell()
inserts the cell directly into the row. The cell does not need to be appended separately with Node.appendChild()
as would be the case if Document.createElement()
had been used to create the new <td>
element.
You can not use insertCell()
to create a new <th>
element though.