Firefox Tomorrow

web api instance method

HTMLTableElement: deleteTHead() method

View on MDN ↗

The HTMLTableElement.deleteTHead() removes the <thead> element from a given <table>.

Syntax

deleteTHead()

Parameters

None.

Return value

None (undefined).

Examples

This example uses JavaScript to delete a table’s header.

HTML

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Occupation</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Bob</td>
      <td>Plumber</td>
    </tr>
    <tr>
      <td>Jim</td>
      <td>Roofer</td>
    </tr>
  </tbody>
</table>

JavaScript

let table = document.querySelector("table");
table.deleteTHead();

Result

Interactive exampleOpen the canonical MDN source to run this embedded demo.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.