Upon page load, I have two tables that are hidden. Depending on a condition, one table should display and the other should hide, or vice versa. The issue is that the table is not displaying as expected when triggered.
I attempted to use jQuery to hide the table, but there was a brief moment where users could see the table for 1-2 seconds upon page load. To address this, I decided to hide the table using CSS display:none instead.
Question 1: How can I ensure the table functions correctly upon action? Question 2: How do I ensure that the displayed table appears in the same position while hiding the other?
Below is my code:
document.getElementById("test1").style.display="block";
document.getElementById("test2").style.display="none";
#test1,#test2{
display:none;
}
<table id="test1" class="display" width="100%" border="1">
<tr>
<td><b>Name :</b> <label for="nme" style="vertical-align: middle"></label></td>
<td><b>Expanded Name :</b> <label for="frml_nme" style="vertical-align: middle"></label></td>
</tr>
</table%26gt;
<table id="test2" class="display" width="100%" border="1">
<tr>
<td><b>Feed Name :</b> <label for="feed_id" style="vertical-align: middle"></label></td>
<td><b>Source :</b> <label for="source" style="vertical-align: middle">></label></td>
</tr>
</table>