X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

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

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook