HTML DOM TableRow deleteCell() Method
The TableRow deleteCell() Method in HTML DOM is used to delete a cell from a current row in a Table. It is a predefined method of the TableRow Object.
index: It contains a numeric value that starts from 0 which defines the position of the cell to be deleted from the current row. For example- The value 0th indicates the first positioned cell to be deleted. The value -1th represent that delete the last positioned cell.
- The parameter is to be defined mandatory in the Firefox and Opera browser. On the other hand, it is optional in safari, chrome and IE Browsers.
- If this parameter is not contain any value, it deleteCell() delete the last cell in IE and the first cell in Chrome and Safari.
Example: In this example, we will delete the first and cell from the current row.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.