THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Table deleteTHead() Method

Table Object Reference 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

Internet Explorer Firefox Opera Google Chrome Safari

The deleteTHead() method is supported in all major browsers.


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 Reference Table Object