Click to See Complete Forum and Search --> : Table Help


comptech520
02-21-2009, 10:09 PM
How can I make the city, state and zip on 1 line


<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><tr><td width="230" class="formLabel">Subject<font color="#FF0000">*</font></td>
<td width="270" nowrap class="formField"><select name="r_Subject" id="r_Subject" title="Subject"><option value='Questions or Comments'>Questions or Comments</option>
<option value='Website Assistance'>Website Assistance</option>
<option value='Other'>Other</option>
</select></td>
</tr><tr><td class="formLabel">Name<font color="#FF0000">*</font></td>
<td class="formField"><input type="text" size="25" name="r_Name" id = "r_Name" value="" title="Name"class="format"></td>
</tr><tr><td class="formLabel">Organization</td>
<td class="formField"><input type="text" size="25" name="Organization" id = "Organization" value="" title="Organization"class="format"></td>
</tr><tr><td class="formLabel">Email Address<font color="#FF0000">*</font></td>
<td class="formField"><input type="text" size="25" name="re_Email_Address" id = "re_Email_Address" value="" title="Email Address"class="format"></td>
</tr><tr><td class="formLabel">Phone<font color="#FF0000">*</font></td>
<td class="formField"><input type="text" size="25" name="r_Phone" id = "r_Phone" value="" title="Phone"class="format"></td>
</tr><tr><td class="formLabel">Address</td>
<td class="formField"><input type="text" size="25" name="Address" id = "Address" value="" title="Address"class="format"></td>
</tr><tr><td class="formLabel">Address Line 2</td>
<td class="formField"><input type="text" size="25" name="Address_Line_2" id = "Address_Line_2" value="" title="Address Line 2"class="format"></td>
</tr><tr><td class="formLabel">City</td>
<td class="formField"><input type="text" size="25" name="City" id = "City" value="" title="City"class="format"></td>
</tr><tr><td class="formLabel">State</td>
<td nowrap class="formField"><select name="State" id="State" title="State"><option value='State'>State</option>
</select></td>
</tr><tr><td class="formLabel">Zip Code</td>
<td class="formField"><input type="text" size="25" name="Zip_Code" id = "Zip_Code" value="" title="Zip Code"class="format"></td>
</tr><tr><td class="formLabel">Questions or Comments</td>
<td class="formField"><textarea rows="5" cols="25" id="Questions_or_Comments" name="Questions_or_Comments" title="Questions or Comments" ></textarea></td>
</tr><tr><td class="formLabel">Type the text from this image. Use top and bottom register.</td><td class="formfield"><br><img src="#" style="border: 1px solid silver;" alt="Captcha Image: you will need to recognize the text in it."></td></tr><tr><td class="formLabel">Security Code</td><td class="formfield"><input class="format" type="text" id="r_captcha" size="0" name="r_captcha" title="Security Code" value=""></td>
</tr></table>

Fang
02-22-2009, 02:28 AM
Put them in one row<tr><td class="formLabel" colspan="2">City<input type="text" size="25" name="City" id = "City" value="" title="City"class="format"> State<select name="State" id="State" title="State"><option value='State'>State</option>
</select> Zip Code<input type="text" size="25" name="Zip_Code" id = "Zip_Code" value="" title="Zip Code"class="format"></td>
</tr>

comptech520
02-22-2009, 02:33 AM
Thank you, I tried that and got this:

http://www.pwmirror.com/contact.php

any other ideas on how to straighten this mess out?

Fang
02-22-2009, 02:55 AM
By reducing the widths of the input fields.

Correct the css:INPUT.format {width: 250px;}
TEXTAREA {width: 250px;}

comptech520
02-22-2009, 02:58 AM
hrmmm same thing

Fang
02-22-2009, 04:01 AM
By reducing the widths of the input fields.
You haven't done this.

comptech520
02-22-2009, 04:06 AM
I've reduced down now, I saw what you meant. Still nothing

Fang
02-22-2009, 04:30 AM
Remove float: left; from .formLabel and .formField

comptech520
02-22-2009, 04:33 AM
hrmmm Same thing. I wonder whats up with that!

Fang
02-22-2009, 04:42 AM
It's not the same, more of the controls are on one line, except that the width of the table (cell) and the width of the controls are causing the wrap.

If you copy someone else's code it is important to understand that code. It's not possible to change or add to the code without understanding it.

comptech520
02-22-2009, 04:43 AM
Thats not someone elses code. Its generated from a form maker

So what do I have to do to make the city, state and zip be on 1 line?

A bit confused?

Fang
02-22-2009, 04:53 AM
Thats not someone elses code. Its generated from a form makerLearn how (http://www.yourhtmlsource.com/myfirstsite/myfirstpage.html) to write html, css and JavaScript the correct way. The generated code is antiquated and invalid.
http://www.websiteoptimization.com/speed/tweak/forms/

Remove width: 100px; from .formLabel and all width attributes from the first row of the table.

WebJoel
02-22-2009, 06:45 AM
In the case of needing a line of data that includes, say, CITY, TOWN, COUNTRY, etc, this is "tabular data" and you should be using TABLEs for this.

I note that "<TH>" is conspicuously absent. You want the "table header" which determine the width of the "table data cell" beneath it (because it will be the parent element.) A "table header" is what 'text-to-speech' readers for the handicapped will 'speak' when you move around the table datas, else, speaking 'the name of the city' or whatever, has no context.
Beauty here in that you state the default width of the TH cell, and not again for the TDs below it.

"TH" in tabular data ("tables") serves the same purpose as "<h>" tags does over a paragraph, it itemized the items 'in the column' below.