Table deleteTFoot() Method - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Table

Description

The deleteTFoot() method removes the <tfoot> element from the table.

Parameters

None

Return Value:

No return value

The following code shows how to Remove a <tfoot> element from a table:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
    border: 1px solid black;
}
</style>/*from   w  w  w.  j av  a 2s .  co  m*/
</head>
<body>

<table id="myTable">
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>
</table>
<br>

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {
    document.getElementById("myTable").deleteTFoot();
}
</script>

</body>
</html>

Related Tutorials