HTML Table at Bottom of Page

brendan-amex
brendan-amex used Ask the Experts™
on
I'm putting together a very simple HTML page with a form on it and I have the form in a table so it lines up correctly but for some reason after putting it into this table it puts the form at the bottom of the page, no matter what. I don't want it to do that! Even the submit button is above it now. Any ideas? My code is below:

<table border="0">
<tr>
<form name="login1" form method="post" action="index.php">
<td>UserName:</td>
<td><input type="text" name="name1" size=30 /><br /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="pass1" size=30 /><br /></td>
</tr>
<input type="submit" name="submit" value="Submit" />
</form>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Please view the source of the page, from the browser perspective, after you submit the form and post the entire code here.

Author

Commented:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="created" content="Mon, 08 Aug 2011 14:50:09 GMT">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <title>MySQL Classroom/Lab Inventory</title>
    
    <style type="text/css">
    <!--
    body {
      color:#000000;
      background-color:#FFFFFF;
    }
    a  { color:#0000FF; }
    a:visited { color:#0000FF; }
    a:hover { color:#00FF00; }
    a:active { color:#0000FF; }
    -->
    </style>
    <!--[if IE]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>
  <body>
<span style="font-family: Arial, Arial, Arial; font-weight: normal; font-style: normal; text-decoration: none; font-size: 10pt;">

<b>MySQL Page:</b><br /><br />

Log In Here:<br /><br />

<table border="0">
<tr>
<form name="login1" form method="post" action="index.php">
<td>UserName:</td>
<td><input type="text" name="name1" size=30 /><br /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="pass1" size=30 /><br /></td>
</tr>
<input type="submit" name="submit" value="Submit" />
</form> 




</span>
   
  </body>
</html>

Open in new window

For one thing, it is incorrect to place a form tag under a table tr tag.  If you want to use a table in a form do this:

<form name="login1" form method="post" action="index.php">
<table border="0">
<tr>
<td>UserName:</td>
<td><input type="text" name="name1" size=30 /><br /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="pass1" size=30 /><br /></td>
</tr></table>
<input type="submit" name="submit" value="Submit" />
</form>

Oh, and by the way, you have no </table> in your code.

Author

Commented:
I didn't close table. </table> posted too quickly, sorry everyone

Author

Commented:
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial