HTMLTableElement.deleteRow()

  • Revision slug: DOM/table.deleteRow
  • Revision title: table.deleteRow
  • Revision id: 143658
  • Created:
  • Creator: CHaoSlayeR
  • Is current revision? No
  • Comment 59 words added, 3 words removed; page display name changed to 'table.deleteRow'

Revision Content

{{ DomRef() }}

Summary

deleteRow removes a row from the table.

Syntax

HTMLTableElement.deleteRow(index)

Return Value

no return value

Parameters

    index is an integer representing the row that should be deleted.
    However, the special index -1 can be used to remove the very last row of a table.

Example

mytable.deleteRow(1);
// delete the second row

Exceptions

  • INDEX_SIZE_ERR
    thrown if the specified index is greater or equal to the number of available rows or when it is negative and not equal to the special index -1

Specification

 

deleteRow

Revision Source

<p>{{ DomRef() }}</p>
<h3 id="Summary" name="Summary">Summary</h3>
<p><strong>deleteRow</strong> removes a row from the table.</p>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<pre class="eval"><em>HTMLTableElement</em>.deleteRow(<em>index</em>)
</pre>
<h3 id="Parameters" name="Parameters">Return Value</h3>
<p>no return value</p>
<h3 id="Parameters" name="Parameters">Parameters</h3>
<ul> <code>index</code> is an integer representing the row that should be deleted.<br> However, the special index <span style="font-family: Courier New;">-1</span> can be used to remove the very last row of a table.
</ul>
<h3 id="Example" name="Example">Example</h3>
<pre class="eval">mytable.deleteRow(1);
// delete the second row
</pre>
<h3 id="Specification" name="Specification">Exceptions</h3>
<ul> <li><span style="font-family: Courier New;">INDEX_SIZE_ERR</span><br> thrown if the specified index is greater or equal to the number of available rows or when it is negative and not equal to the special index <span style="font-family: Courier New;">-1</span></li>
</ul>
<h3 id="Specification" name="Specification">Specification</h3>
<p> </p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-13114938">deleteRow</a>
Revert to this revision