Back to Content

HTMLTableElement: deleteTFoot() method

files/en-us/web/api/htmltableelement/deletetfoot/index.md

latest896 B
Original Source

{{APIRef("HTML DOM")}}

The HTMLTableElement.deleteTFoot() method removes the {{HTMLElement("tfoot")}} element from a given {{HtmlElement("table")}}.

Syntax

js-nolint
deleteTFoot()

Parameters

None.

Return value

None ({{jsxref("undefined")}}).

Examples

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

HTML

html
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Score</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Bob</td>
      <td>541</td>
    </tr>
    <tr>
      <td>Jim</td>
      <td>225</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th>Average</th>
      <td>383</td>
    </tr>
  </tfoot>
</table>

JavaScript

js
let table = document.querySelector("table");
table.deleteTFoot();

Result

{{EmbedLiveSample("Examples")}}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}