<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<table id="myTable">
<thead>
<tr>
<th>Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cell 1</td>
</tr>
<tr>
<td>Cell 2</td>
</tr>
</tbody>
</table>
<p>Click the button to create a TFOOT element (and a TR and a TD).</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var x = document.createElement("TFOOT");
var y = document.createElement("TR");
var z = document.createElement("TD");
z.innerHTML = "A Footer!"
y.appendChild(z);
x.appendChild(y);
document.getElementById("myTable").appendChild(x);
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_tfoot_create by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:08:22 GMT -->
</html>