HTMLTableElement.deleteTHead()

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

Syntax

HTMLTableElement.deleteTHead();

Example

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

HTML

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

JavaScript

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

Result

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'HTMLTableElement: deleteTHead' in that specification.
Living Standard

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
deleteTHeadChrome Full support YesEdge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android ? Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support
Full support
Compatibility unknown
Compatibility unknown