Right Aligning Text in an html text box
This one was bugging me yesterday. Since it took a while to find the answer I figured this is a good example of what is supposed to be in this blog.
As long as you are not using an early version of Netscape, this should work. Basically this is what we do:
[input type="text" style="TEXT-ALIGN: right" size="30" value="This is a right aligned Text Box"]
(The PRE and < tags don't work in Blogspot, so just replace the [ with a < and the > with a ] )
The key piece is style='text-align: right;'. There is basically a mini-style sheet inside the Text Box. Why do we care? Well if you have cells with numbers it can mean that you can now format and enter numbers the way users expect to see them, like this:
...instead of like this:
Enjoy your Thursday :)
0 Comments:
Post a Comment
<< Home