Js Table
Js Table
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
table {
width: 50%;
border-collapse: collapse;
th, td {
padding: 10px;
text-align: center;
th {
background-color: #f2f2f2;
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Number</th>
<th>Square</th>
<th>Cube</th>
</tr>
</thead>
<tbody id="table-body">
</tbody>
</table>
<script>
const square = i * i;
const cube = i * i * i;
row.innerHTML = `<td>${i}</td><td>${square}</td><td>$
{cube}</td>`;
tableBody.appendChild(row);
</script>
</body>
</html>