0

Hi,
i'm doing a registration form, and i'm aligning the labels and textbox's. But they are very close of each other, so i put a td between the td's which are seperating the label and the textbox.

<tr>
			<td align="right">
				<br/>
				<div class="field"><label>Username*: </label>
			</td>
			
			<td>
			</td>
			
			<td>
				<input type="text" size="30" name = "username"/></div>
			</td>
		</tr>

But hte problem is that the textbox...:
http://img850.imageshack.us/img850/5910/semttulopc.jpg

And if you can help me you could tell me how to change the size and type of the font... xD

Thank you,
PF2G

3
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by PF2G
0

THis isn't php , but how about placing the textbox in the second cell as opposed to the third? The use of a div across tds is wrong. HTML needs to be 'well-formed'. I don't see why you need a div at all. Additionally if you want a form control to span more than one cell you can do this:

<td colspan="2"><input name="username" id="username" class="double" /></td>

Then in your CSS:

input[type=text]{
   width: 100px;
}
input.double{
   width: 200px;
}

The first rule gives textboxes a default width of 100px, while any control with the class=double has a width of 200px.

There are a few ways which you could do this - this is just one.

0

Looks like you finish divs and labels sporadic places:
for aligning in a table you can (However I think this is in the html forum if that exists)

<table>
<tr>
<td>Username*:</td><td><input type"text" name="username" /></td>
</tr>
<tr>
<td>Password*:</td><td><input type"password" name="pass1" /></td>
</tr>
<tr>
<td>Confirm Password*:</td><td><input type"password" name="pass2" /></td>
</tr>
<table>

And then add padding for the td..

Edited by klemme: n/a

0
<td colspan="2"><input name="username" id="username" class="double" /></td>

Then in your CSS:

input[type=text]{
   width: 100px;
}
input.double{
   width: 200px;
}

It gives me the same thing the text box goes "all" to the left.

Edited by PF2G: n/a

0

SHow the code you're now using, including relevant CSS and table html.

Second thoughts - ask a mod to move this thread to the right forum. THis ain't php

Edited by diafol: n/a

0

top.php

<style type="text/css">
input[type=text]{
   width: 100px;
}
input.double{
   width: 200px;
}
</style>

registration.php

<tr>
			<td align="right">
				<br/>
				<div class="field"><label>Username*: </label>
			</td>
			
			<td>
			</td>
			
			<td colspan="2">
				<input name="username" id="username" class="double" />
			</td>
		</tr>
0

What's this for?

<td></td>

The whole point of having colspan="2" is that you merge 2 td tags:

<td></td><td></td> -> <td colspan="2"></td>

0

What's this for?

<td></td>

The whole point of having colspan="2" is that you merge 2 td tags:

<td></td><td></td> -> <td colspan="2"></td>

So, is this correct:

<tr>
			<td align="right">
				<br/>
				<div class="field"><label>Username*: </label>
			</td>
			
			<td>
			</td>
			
			<td>
				<input name="username" id="username" class="double" />
			</td>
		</tr>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.