THE WORLD'S LARGEST WEB DEVELOPER SITE

Table deleteTHead() Method

❮ Table Object

Example

Remove a <thead> element from a table:

document.getElementById("myTable").deleteTHead();
Try it Yourself »

Definition and Usage

The deleteTHead() method removes the <thead> element (and its content) from the table.

Tip: To create a new <thead> element for a table, use the createTHead() method.


Browser Support

Method
deleteTHead() Yes Yes Yes Yes Yes

Syntax

tableObject.deleteTHead()

Parameters

None


Technical Details

Return Value: No return value

More Examples

Example

Create and delete a <thead> element:

function myCreateFunction() {
    var table = document.getElementById("myTable");
    var header = table.createTHead();
    var row = header.insertRow(0);
    var cell = row.insertCell(0);
    cell.innerHTML = "<b>This is a table header</b>";
}

function myDeleteFunction() {
    document.getElementById("myTable").deleteTHead();
}
Try it Yourself »

Related Pages

HTML reference: HTML <thead> tag


❮ Table Object