You are trying to alter the behaviour of onclick
inside the same function call. Try it like this:
<a id="loginLink" onclick="toggleTable();" href="#">Login</a>
function toggleTable() {
var lTable = document.getElementById("loginTable");
lTable.style.display = (lTable.style.display == "table") ? "none" : "table";
}