Jump to content

Form Alignment


Imoddedu

Recommended Posts

How can I align all form input areas to same side? What I mean is, you know how when you post a new topic, the "Topic Title" and "Topic Description" input areas start in at the same place, right on top of each other. How can you make it like that?

Link to comment
Share on other sites

In the case of this forum, it's a table:

<table>  <tr>    <td>Topic title</td>    <td><input /></td>  </tr>  <tr>    <td>Topic description</td>    <td><input /></td>  </tr></table>

Link to comment
Share on other sites

Again: With a table....Imagine any table you've ever seen (the firniture kind of table excluded)... have you noticed that the content in each first cell on a row always starts at the same place (except maybe in special cases), and so is the content in every second cell on a row, etc.The same effect is next to impossible to achieve without a table of some kind. In modern browsers (IE8, and all versions of all other browsers), you can use the CSS "display" property on any element with a corresponding value that mimics a table element. If you're concerned with IE7 and below though, again, it's next to impossible to achieve this.

Link to comment
Share on other sites

Err, the effect can also be achieved by making the labels and input display:block (with fixed width), then floating them left, wrapping them in a clearing division (for good measure) and then giving the labels text-align:right.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...