Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    205
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Formatting/aligning form elements.

    I want to vertically align my form elements, i.e. text boxes, check boxes, radio buttons, etc.. What is the best way to do that? Currently to perform the alignments, I've been using inline code (see code below):

    Code:
    <form name="Register" id="Register" method="post" onsubmit="Registration()" style="padding: 10px; border-bottom:#FF9900 dotted;">
    <table width="200" border="0" cellpadding="10" cellspacing="0">
    <tr>
    	<td>
        	<p>First Name: <br/> <input type="text" name="firstName" id="firstName" /> </p>
    	<p>Last Name: <br/> <input type="text" name="lastName" id="lastName" /> </p>
    	<p>Sex: <br/> <input type="radio" name="sex" value="male" style="margin-left: -5px;" />Male &nbsp; <input type="radio" name="sex" value="female" />Female </p>
        </td>
    	<td>
        	<p>Email Address: <br/> <input type="text" name="email" id="email" /> </p>
    	<p>Password: <br/> <input type="password" name="password" id="password" /> </p>
    	<p>Confirm Password: <br/> <input type="password" name="confirmPassword" id="confirmPassword" /> </p>
        </td>
    </tr>
    <tr>
    	<td colspan="2"><center><input type="submit" name="submit" value="Sign-Up"/></center>
        <input type="hidden" name="type" value="Registration" />
        </td>
    </tr>
    </table>
    </form>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Never use tables to format the form. See http://www.alistapart.com/articles/p...ccessibleforms
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •