Search code examples
htmlcsshtml-tablealignment

Align one form and two text areas


I've got a FORM which contains a 32*50 TEXTAREA and a Submit button.

Now I'd like to align horizontally two text areas that contains additional information. Ideally the three text areas (the one in which the user can type/paste and the two others) should have the same width and appear in three aligned columns.

If I wanted to do that, should I use only HTML? If so, how? A table with one row and three td? (Sample code would be most welcome).

Or would you rather suggest CSS?


Solution

  • textarea is inline element and they would be horizontally aligned if the container is larger enough in width. So, see http://jsfiddle.net/FATfJ/ I don't know if this is the exact one you need.

    code:

    <form id="a-form">
      <textarea></textarea>
      <textarea></textarea>
      <textarea></textarea>
    </form>
    
    #a-form textarea {width: 100px;}