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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vertical Text Alignment

Status
Not open for further replies.

scripter73

Programmer
Apr 18, 2001
421
US
Hi,
I have a really, really nit-picky user. Does anyone know what's wrong with this code? I'm trying to get my text to touch the top of the cell its in, and I'm doing the valign="top", but nothing changes.

Here's a snippet of my code that has what I want aligned. Basically, I want "Street Address", "State", and "City" to be top aligned.

Also, if you want to look at the full page, its in in the "INCIDENT INFORMATION" section.

Thanks in advance.

<table cellpadding=0 cellspacing=0 width=600 border=1>
<!--blank row
<tr>
<td width=300 colspan=2><br>
</td></tr> -->
<td width=300 align=&quot;center&quot; valign=&quot;top&quot;>
</td>
</tr>

<tr>
<td width=200 colspan=2>
<font size=2><b>Location of incident or accident:</b><img src=&quot;images/menubutton.gif&quot;></font>
</td>
<td width=300 valign=&quot;bottom&quot;><font size=2>
<input type=&quot;text&quot; maxlength=30 size=35>
</td>
</tr>

<tr>
<td width=300 colspan=2>
</td>

<td width=300 align=&quot;center&quot; valign=&quot;middle&quot; bgcolor=&quot;yellow&quot;>
<font size=&quot;-3&quot;>Street Address</font>
</td>

</tr>

<tr>
<td width=300 colspan=2>
</td>
<td width=300 colspan=2>
<input type=&quot;text&quot; maxlength=20 size=30> <select name=&quot;state&quot;>
<option value=&quot;#&quot; selected></option>
<option value=&quot;AL&quot;>AL </option>
<option value=&quot;AK&quot;>AK </option>
<option value=&quot;AZ&quot;>AZ </option>
<option value=&quot;AR&quot;>AR </option>
<option value=&quot;CA&quot;>CA </option>
<option value=&quot;CO&quot;>CO </option>
<option value=&quot;CT&quot;>CT </option>
<option value=&quot;DE&quot;>DE </option>
<option value=&quot;D.C.&quot;>DC </option>
<option value=&quot;FL&quot;>FL </option>
<option value=&quot;GA&quot;>GA </option>
<option value=&quot;HI&quot;>HI </option>
<option value=&quot;ID&quot;>ID </option>
<option value=&quot;IL&quot;>IL </option>
<option value=&quot;IN&quot;>IN </option>
<option value=&quot;IA&quot;>IA </option>
<option value=&quot;KS&quot;>KS </option>
<option value=&quot;KY&quot;>KY </option>
<option value=&quot;LA&quot;>LA </option>
<option value=&quot;ME&quot;>ME </option>
<option value=&quot;MD&quot;>MD </option>
<option value=&quot;MA&quot;>MA </option>
<option value=&quot;MI&quot;>MI </option>
<option value=&quot;MN&quot;>MN </option>
<option value=&quot;MS&quot;>MS </option>
<option value=&quot;MO&quot;>MO </option>
<option value=&quot;MT&quot;>MT </option>
<option value=&quot;NE&quot;>NE </option>
<option value=&quot;NV&quot;>NV </option>
<option value=&quot;NH&quot;>NH </option>
<option value=&quot;NJ&quot;>NJ </option>
<option value=&quot;NM&quot;>NM </option>
<option value=&quot;NY&quot;>NY </option>
<option value=&quot;NC&quot;>NC </option>
<option value=&quot;ND&quot;>ND </option>
<option value=&quot;OH&quot;>OH </option>
<option value=&quot;OK&quot;>OK </option>
<option value=&quot;OR&quot;>OR </option>
<option value=&quot;PA&quot;>PA </option>
<option value=&quot;RI&quot;>RI </option>
<option value=&quot;SC&quot;>SC </option>
<option value=&quot;SD&quot;>SD </option>
<option value=&quot;TN&quot;>TN </option>
<option value=&quot;TX&quot;>TX </option>
<option value=&quot;UT&quot;>UT </option>
<option value=&quot;VT&quot;>VT </option>
<option value=&quot;VA&quot;>VA </option>
<option value=&quot;WA&quot;>WA </option>
<option value=&quot;WV&quot;>WV </option>
<option value=&quot;WI&quot;>WI </option>
<option value=&quot;WY&quot;>WY </option>
</select>
</td>
</tr>

<tr>
<td width=300 colspan=2></td>
<td width=300 align=&quot;center&quot; valign=&quot;top&quot;>
<font size=-3>City        
                
               State</font>
</td>
</tr>
 
The problem is the line breaks that are outside of the <font> tags in the cell are considered to be SPACES of the default font size. Try removing the line breaks and put the entire cell info <td> thru </td> on one line, with no text outside the font tags. This will give you a pretty skinny row, but you can set the row height and use valign=top to get a taller row with the text at the top. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
try setting up the page formatting with a css. this will remove a lot of the font code that will on occation be read wrong by ie and ns and put spaces n' stuff in there.

hope this helps.

Manic
-----------------------------
I've broken it again !!
-----------------------------
 
Except that NN seems to have a problem applying styles to table cells. You can use styles INSIDE table cells (with <span>, for instance), but that's very little different than what is already being done with the font tag, and neither method prevents the problem of having spaces outside of the tags. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
i don't know, but this might work...it's something that the others might not have picked up on but i tend to spend alot of time on code checking and all...
anywayz the row with ure select tag, if you add up the colspans they add up to 4 whereas the other rows there are only 3 columns as the second td doesn't have any colspan..

check it out, see if i make any sense :)

arif
X-) s-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top