You need to modify your function as:
function toggleTable()
{
if (document.getElementById("loginTable").style.display == "table" ) {
document.getElementById("loginTable").style.display="none";
} else {
document.getElementById("loginTable").style.display="table";
}
currently it is checking based on the boolean
parameter, you don't have to pass the parameter with your function.
You need to modify your anchor tag as:
<a id="loginLink" onclick="toggleTable();" href="#">Login</a>