title: How to align input boxes in a form
body: <p>I'm looking for a way to make the inputs straight using CSS. I already used a table and it doesn't work. </p>
  
  <p>Here is a picture of the misaligned input boxes:</p>
  
  <p><a href="https://i.stack.imgur.com/hIqRy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hIqRy.png" alt="Misaligned boxes"></a></p>
  
  <p><strong>CODE</strong></p>
  
  <pre><code>&lt;form action="register2.php" method="POST"&gt;
       &lt;table&gt;
          &lt;tr&gt;
          &lt;td&gt;
          First Name: &lt;input type="text" name="name"&gt;
          &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
          &lt;td&gt;
          Last Name: &lt;input type="text" name="lname"&gt;
          &lt;/tr&gt;
          &lt;/td&gt;
          &lt;tr&gt;
          &lt;td&gt;
          UserName: &lt;input type="text" name="uname"&gt;
          &lt;/tr&gt;
          &lt;/td&gt;
          &lt;tr&gt;
          &lt;td&gt;
          Email: &lt;input type="text" name="email1"&gt;
          &lt;/tr&gt;
          &lt;/td&gt;
          &lt;tr&gt;
          &lt;td&gt;
          Confirm Email : &lt;input type="text" name="email2"&gt;
          &lt;/tr&gt;
          &lt;/td&gt;
          &lt;tr&gt;
          &lt;td&gt;
          Password: &lt;input type="password" name="pass1"&gt;
          &lt;/tr&gt;
          &lt;/td&gt;
          &lt;tr&gt;
          &lt;td&gt;
          Confirm Password: &lt;input type="password" name="pass2"&gt;
          &lt;/tr&gt;
          &lt;/td&gt;
          &lt;tr&gt;
          &lt;td&gt;
          &lt;input type="submit" name="Submit" value="Register"&gt;
          &lt;tr&gt;
          &lt;td&gt;
       &lt;/table&gt;
      &lt;/form&gt;
  </code></pre>