In this article I will explain with an example, how to delete (remove) all rows from an HTML Table except First (Header) row using jQuery.
Delete all rows from Table except First (Header) row using jQuery
The following HTML Markup consists of an HTML Table with a Header row and three other rows and a Button. The Button has been assigned a jQuery OnClick event handler.
When the Button is clicked, all the TR (Table Row) elements except the First (Header) row are selected and then removed using the jQuery remove function.
<table id="tblCustomers" border="0" cellpadding="0" cellspacing="0">
            <th style="width: 90px">Customer Id</th>
            <th style="width: 120px">Name</th>
            <th style="width: 90px">Country</th>
            <td>John Hammond</td>
            <td>United States</td>
            <td>Mudassar Khan</td>
            <td>Suzanne Mathews</td>
            <td>Robert Schidner</td>
<hr />
<input type="button" id="btnDelete" value="Delete Rows" />
<script type="text/javascript" src=""></script>
<script type="text/javascript">
    $(function () {
        $("#btnDelete").click(function () {
Delete all rows from Table except First (Header) row using jQuery
Browser Compatibility

The above code has been tested in the following browsers.

Internet Explorer  FireFox  Chrome  Safari  Opera 

* All browser logos displayed above are property of their respective owners.