Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text boxes dont line up 1

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
US
I have 4 text boxes that I want to uniformly line up one on top of the other. I cannot find a way to do this, here is the code.
Thanks
Timgerr


Code:
<form action="form1.php">
<strong>CoreID</strong>
<input type="text" name="CoreID">
<br>

<strong>First Name</strong>      
<input type="text" name="Fname">
<br>

<strong>Last Name</strong>
<input type="text" name="Lname">
<br>

<strong>Phone Number</strong>
<input type="text" name="PNumber">
<br>

<strong> Reason for needing access to <?= $row[colFolder]; ?> folder?</strong> <br>

<!-- 
This is hidden information  -->

<input type= "hidden" name= "ID" value= <?= $row[ID]; ?>>
<input type= "hidden" name= "Location" value= <?= $row[colLocation]; ?>>
<input type= "hidden" name= "Folder" value= <?= $row[colFolder]; ?>>
<input type= "hidden" name= "Owner" value= <?= $row[colOwner]; ?>>
<input type= "hidden" name= "Email" value= <?= $row[colEmail]; ?>>

<textarea name="info" rows="10" cols="80"> </textarea> <br>
<input type="submit">
</form>
 
<table>
<tr><td style="font-weight:bold">CoreID</td>
<td><input type="text" name="CoreID"></td>
</tr>

<tr><td style="font-weight:bold">First Name</td>
<td><input type="text" name="Fname"></td>
</tr>

<tr><td style="font-weight:bold">Last Name</td>
<td><input type="text" name="Lname"></td>
</tr>

<tr><td style="font-weight:bold">Phone Number</td>
<td><input type="text" name="PNumber"></td>
</tr>
</table>
 
Arr! Tables! ;)

timgerr: where you've got <strong>, use the <label> tag - it's the correct markup for a form label:
Code:
form action="form1.php">
<label for="CoreID">CoreID</label>
<input type="text" name="CoreID" id="CoreID">
<br>

<label for="Fname">First Name</label>      
<input type="text" name="Fname" id="Fname">
<br>

<label for="Lname">Last Name</label>
<input type="text" name="Lname" id="Lname">
<br>
The 'for' attribute intrinsicly ties the label with a form element and improves web accessibility.
The 'for' attribute corresponds to the elements 'ID' attribute.



The accompanying css could look something like:
Code:
label, input {
  float: left; 
  clear: left;
  margin: 1px 3px;
}
label {
  width: 10em;
}

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top