HTML DOM deleteRow() Method
Complete Table Object Reference
Definition and Usage
The deleteRow() method is used to delete the row at the specified position from a table.
Syntax
tableObject.deleteRow(index)
|
Example
The following example deletes the first row of the table:
<html>
<head>
<script type="text/javascript">
function delRow()
{
document.getElementById('myTable').deleteRow(0)
}
</script>
</head>
<body>
<table id="myTable" border="1">
<tr>
<td>Row1 cell1</td>
<td>Row1 cell2</td>
</tr>
<tr>
<td>Row2 cell1</td>
<td>Row2 cell2</td>
</tr>
</table>
<br />
<input type="button" onclick="delRow()"
value="Delete first row">
</body>
</html>
|
Try-It-Yourself Demos
Delete rows from a table
Complete Table Object Reference
Learn XML with <oXygen/> XML Editor - Free Trial!
|
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|