Note that this method should be invoked on a reference to the <tr> element of a table.
Note: you can use the deleteCell() method to remove a cell from a table row.
insertCell() Method Syntax:
insertCell() Method Parameter
The method takes one argument, and that is the index number where we want to insert the new cell.
The value 0 means insert the cell as the first cell of the target <tr>.
The value -1 means insert the cell as the last cell of the target <tr>.
This value is optional and, if ignored, the new cell will be inserted as the last cell of the target <tr> element.
insertCell() Method Return Value
The method returns a reference to the newly created cell.
Note: please check the insertRow() section if you’re not familiar with this method.