Page 1 of 1

Why are the <td>s not next to each other?

Posted: Mon Sep 20, 2004 1:33 pm
by voltrader

Code: Select all

<table class="verdana_grey_2" width="80%" align="center" cellspacing="0" cellpadding="0" border=1>
<tr>


	<td width="30%">
		<tr>
			<td>
				name
			</td>
		</tr>
		<tr>
			<td>
				<input type=text size=30 name="a" value="">
			</td>
		</tr>
	</td>

	
	<td width="30%">
		<tr>
			<td>
				number
			</td>
		</tr>
		<tr>
			<td>
				<input type=text size=20 name="b" value="">
			</td>
		</tr>
	</td>
	
	<td width="30%">
		<tr>
			<td>
				or select
			</td>
		</tr>
		<tr>
			<td>
				<select name='c'>
				<option>---</option>
				<option>1</option>
				<option>2</option>
				<option>3</option>
				<option>4</option>
				</select>
			</td>
		</tr>
	</td>
	
</tr>
</table>
Aim was to have 3 columns in table with "name", "number" and "or select" above two input boxes and drop-down, respectively.

For some reason, <td>s are wrapping to next row.

What's wrong here?

Posted: Mon Sep 20, 2004 1:38 pm
by ldomingues
You cannot use <TR> inside <TD>. If you want to use <TR>, you must create a complete table inside a <TD>.

Posted: Mon Sep 20, 2004 1:39 pm
by voltrader
got it, thanks

Posted: Mon Sep 20, 2004 8:58 pm
by John Cartwright
generally, you should minimize the number of tables. Infact, while your at it, don't use them at all and get into using div's.. something I wish a long time ago :)

Posted: Mon Sep 20, 2004 9:09 pm
by nigma
No phenom! You changed your avatar!

Posted: Tue Sep 21, 2004 12:16 am
by phice
Phenom wrote:generally, you should minimize the number of tables. Infact, while your at it, don't use them at all and get into using div's.. something I wish a long time ago :)
Only if I can find a decent tutorial for people who always use tables that would like to convert to <div.