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 Alignment

Status
Not open for further replies.

OceanDesigner

Programmer
Oct 30, 2003
173
US
I have the following html printing on a single line:

Code:
<p>1&nbsp;&nbsp;<textarea rows="2" name="S1" cols="20"></textarea></p>

This prints the character "1", a couple of spaces and then a multi-line text box. The "1" is aligned with the bottom of the text box. I cannot figure out how to align the "1" with the top of the text box. I appreciate any help.

Jeff
 

One way:

Code:
<table border="0"><tr valign="top">
<td>1&nbsp;&nbsp;</td>
<td><textarea rows="2" name="S1" cols="20"></textarea></td>
</tr></table>

*cLFlaVA
----------------------------
Ham and Eggs walks into a bar and asks, "Can I have a beer please?"
The bartender replies, "I'm sorry, we don't serve breakfast.
 
I was difficulty using tables for my problem. I have attached the whole code (at least the parts that pertain to this problem). The page works like this. There is a link on the page. When the user clicks the link, a javascript function is activated that inserts an additional text box below the previous text box. Simple enough. The code works if I use breaks and spaces, but doesn't seem to work with table tags. I guess it does not like to insert cells and rows. I am open to the idea of tables, or anything else, if I can get it to work.

Code:
function adddesc() {
 var ndesc = parseInt(uform.NDesc.value)
 ndesc = ndesc + 1
 uform.NDesc.value = ndesc
 field = ndesc + "&nbsp;&nbsp;<textarea rows='3' name='desc" + ndesc +"' cols='53'></textarea>"
 document.getElementById("Desc").insertAdjacentHTML("BeforeEnd", "<br>" + field)
 fld = "desc" + ndesc
 uform[fld].focus();
}
...
<tr>
 <td valign="top">
  <div id="Desc" valign="top">
   1&nbsp;&nbsp;<textarea rows="3" name="desc1" cols="53"></textarea>
  </div>
 </td>
</tr>
<tr>
 <td valign="top" colspan="2">
  <a href="javascript:adddesc()" class="Blue"><b>Add a discrepancy</b></a>
 </td>
</tr>
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top