Forum Moderators: open

Message Too Old, No Replies

Text input alignment question

probably a simple answer

         

Argblat

6:25 pm on Feb 11, 2005 (gmt 0)

10+ Year Member



Is there a way to tweak the properties of a input box, type text, so that the text that get's entered is right aligned to inside of the box, ala a simple calculator?

Example:

<table>
<tr>
<td>1</td>
<td><input type="text" name="txtRow1" size="40" /></td>
</tr>
</table>

How do I make the text inputted into the text box line up to the right?

Thank you
-Mike

birdbrain

10:14 pm on Feb 11, 2005 (gmt 0)



Hi there Argblat,

just add this to your input tag...

style="text-align:right"

birdbrain

g1smd

10:05 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you have more than one input tag to style this way, then add a class to the <table> like this:

<table class="theclass">

and in your style sheet style it with:

.theclass input { thestyleinfo; }

This reduces repetition of using the class, and makes the code cleaner.