<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Technopat</title>
<style>
table, tr, th, td {
border: 1px solid black;
border-collapse: collapse;
margin-bottom: 16px;
}
#count-row th, #user-row th, #computer-row th {
font-family: sans-serif;
padding: 8px;
}
#user-row td, #computer-row td {
text-align: center;
}
</style>
</head>
<body>
<table>
<tr id="count-row">
<th>/</th>
</tr>
<tr id="user-row">
<th>User</th>
</tr>
<tr id="computer-row">
<th>Computer</th>
</tr>
</table>
<button onclick="addColumn()">Add Column</button>
<script>
let count = 1;
function addColumn() {
const countRow = document.getElementById("count-row")
const userRow = document.getElementById("user-row")
const computerRow = document.getElementById("computer-row")
countRow.innerHTML += `<th>${count}</th>`;
count++;
userRow.innerHTML += `<td>${~~(Math.random() * 6)}</td>`
computerRow.innerHTML += `<td>${~~(Math.random() * 6)}</td>`
}
</script>
</body>
</html>