Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4339144
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:10:38+00:00 2026-05-21T11:10:38+00:00

One part of web development (from a front-end perspective) is laying out forms. There

  • 0

One part of web development (from a front-end perspective) is laying out forms. There is never a standard set, and I’ve seen people continuing to use <tables> to keep styling consistent. Say you were to lay out this form:

enter image description here

At first glance it seems that a table would make laying out this form easy. Another options is to use <fieldset>‘s, with perhaps a list inside them. Float the fieldsets to the left, give them equal widths.

My question is what is the most standard way of laying out forms? There seem to be several techniques, but many of them don’t work cross browser.

How would you do it? And why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:10:39+00:00Added an answer on May 21, 2026 at 11:10 am

    I must say, the most common way to do this would be to use tables. Unfortunately, there are problems with table based form layouts (big surprise). One big thing is that tables will bleed over their containers (if overflow is not hidden) and they don’t squash their contents like CSS can do. On top of that, rendering tables is more expensive (takes up more CPU cycles). Overall, I think that, compared to pure CSS solutions, table based form layouts are rigid and inflexible, and as a designer, I cringe (and you should, too!) at using tables for layout purposes to begin with.

    A method that I am beginning to like (and that is growing more popular) is a pure, CSS2 method for laying out forms. I will not credit myself for coming up with the idea, but it is really straight forward. All you have to do is this:

    THE HTML:

    <form action="process.php" method="post">
        <label for="username">Username:</label>
        <input type="text" name="username" id="username" />
        <br />
        <label for="password">Password:</label>
        <input type="password" name="password" id="password" />
    </form>
    

    THE CSS:

    label, input {
        width:200px;
        display:block;
        float:left;        
        margin-bottom:10px;
    }
    label {
        width:125px;
        text-align:right;
        padding-right:10px;
        margin-top:2px;
    }
    br {
        clear:left;
    }
    

    As you can see, the CSS code is really minimal and the results are really awesome. The pros of this method is that it uses less code (faster to download), it is cleaner without all the messy table tags littering your HTML document (maintainability), and I believe web browsers will render the CSS method faster.

    Update 1: I also found a CSS method using unordered lists.

    Update 2: @musicinmyhead reminded me about using fieldset and legend tags in CSS form layouts. I coded us a quick and dirty little demo here.

    Note: I originally learned of this pure CSS form layout from: http://www.cssdrive.com/index.php/examples/exampleitem/tableless_forms/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I extract the part of this stream (the one named BLABLABLA) from
As the title really, I'm in one part of my code and I would
Should libraries that the application relies on be stored in source control? One part
I have an OpenGL ES game that I am hacking together. One part of
I'm working with some example java code for making md5 hashes. One part converts
I have a site in rails and want to have site-wide settings. One part
I have an application that I have to run as Administrator. One small part
So let's say I have two different functions. One is a part of the
Our project has one folder that is not part of the solution. How can
If one has a project that has tests that are executed as part of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.