I have 6 links. I would like for when I click on a link that table shows next to it. I need the table to show in same page as link and not replace it. So I need all tables hidden until i click that link. For the 6 different tables they each have their own .html file I'm pulling them from. Heres my code:
function show(nr) {
document.getElementById("table1").style.display = "none";
document.getElementById("table2").style.display = "none";
document.getElementById("table3").style.display = "none";
document.getElementById("table4").style.display = "none";
document.getElementById("table5").style.display = "none";
document.getElementById("table6").style.display = "none";
document.getElementById("table" + nr).style.display = "block";
}
td {
vertical-align: center;
}
#table1,
#table2,
#table3,
#table4,
#table5,
#table6 {
display: none;
}
<h1>BV-Line58 Demi</h1>
<br>
<table>
<tr>
<td>
<a href="bv-line58assets.html" name="table1" onclick='show(1); '>Assets</a>
<br><br>
<a href="bv-line58endpoints.html" name="table2" onclick='show(2);'>Endpoints</a>
<br><br>
<a href="#" name="table3" onclick='show(3);'>IP Search</a>
<br><br>
<a href="#" name="table4" onclick='show(4);'>Non-Malicious Alerts</a>
<br><br>
<a href="bv-line58routes.html" name="table5" onclick='show(5);'>Routes</a>
<br><br>
<a href="#" name="table6" onclick='show(6);'>Suricata Alerts</a>
</td>
<td>
</td>
<td>
<div id="table1"></div>
<div id="table2"></div>
<div id="table3"></div>
<div id="table4"></div>
<div id="table5"></div>
<div id="table6"></div>
</td>
</tr>
</table>