I don't understand your problem fully but I will try my level best to explain.
Your problem is:
1. You have a button which is not working
2. You need to show tables on the link/button is pressed.
Here an example code for your learning
<!--
<!DOCTYPE html>
<html>
<head>
<title>Buttons and Tables</title>
<script type="text/javascript">
function show_table(_id)
{
let div = document.getElementById(_id);
if(div.style.display==="none")
{
div.style.display = "block";
}
else
{
div.style.display = "none";
}
}
function add_row(_id)
{
let table_one = document.getElementById(_id);
let row =table_one.insertRow(-1);
let c1 = row.insertCell(0);
let c2 = row.insertCell(1);
c1.innerText ="SOMETHING";
c2.innerText ="SOMETHING";
}
</script>
</head>
<body>
<!--
<div id="div_one" style="display: none;">
<table id="table_one" border="1">
<thead>
<tr>
<th>SNO FOR TABLE 1</th>
<th>NAME FOR TABLE 1</th>
</tr>
</thead>
<tbody>
<!--
</tbody>
</table>
</div>
<div id="div_two" style="display: none;">
<table id="table_two" border="1">
<thead>
<tr>
<th>SNO FOR TABLE 2</th>
<th>NAME FOR TABLE 2</th>
</tr>
</thead>
<tbody>
<!--
</tbody>
</table>
</div>
<!--
<!--
<button type="button" onclick="show_table(this.value);" value="div_one">SHOW TABLE 1</button>
<button type="button" onclick="show_table(this.value);" value="div_two">SHOW TABLE 2</button>
<!--
<button type="button" onclick="add_row(this.value)" value="table_one">ADD A ROW IN TABLE 1</button>
<button type="button" onclick="add_row(this.value)" value="table_two">ADD A ROW IN TABLE 2</button>
</body>
</body>
</html>