javascript deleteRow() method


  Translation results:

delete

UK[dɪˈli:t] US[diˈlit]

vt.& vi.Delete

row

英[rəʊ] 美[roʊ]

n. rowing; line, row; noisy; road, street

vt. rowing; rowing; with ...have a rowing race; quarrel, make noise

Third person singular: rows Plural: rows Present participle: rowing Past tense: rowed Past participle: rowed

javascript deleteRow() methodsyntax

Function: Used to delete the row at the specified position from the table.

Syntax: tableObject.deleteRow(index)

Description: The parameter index specifies the position of the row to be deleted in the table . Lines are encoded in the order in which they appear in the document source code. The rows in <thead> and <tfoot> are encoded along with the other rows in the table.

javascript deleteRow() methodexample

<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>

Run instance »

Click the "Run instance" button to view the online instance

Home

Videos

Q&A