By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,650 Members | 1,778 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,650 IT Pros & Developers. It's quick & easy.

Text alignment in <textarea> html tag

P: n/a
This may seem a stupid question.
I've got a <textarea> element:

....
<td>
List of items:
<textarea>
1. Apple
2. Orange
3. Box
4. Computer
5. Wallet
</textarea>

</td>
....

The output onscreen will have the white space to the left.
How can I instruct the textarea to left align all text?
I want to keep indentation in my source code so it'll look better (not
a must) rather than aligning the textarea to the left.
Furthermore, it is dynamically generated (JSP) so keeping the source
code nicely formatted is even a greater plus.
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
jt***@oaohs.com (Jonathan Taub) wrote:
This may seem a stupid question.
I've got a <textarea> element:

...
<td>
List of items:
<textarea>
1. Apple
2. Orange
3. Box
4. Computer
5. Wallet
</textarea>

</td>
...

The output onscreen will have the white space to the left.
How can I instruct the textarea to left align all text?
I want to keep indentation in my source code so it'll look better (not
a must) rather than aligning the textarea to the left.
Furthermore, it is dynamically generated (JSP) so keeping the source
code nicely formatted is even a greater plus.


Spaces in a textarea are, and must be, significant, so you can't
simultaneously include them in the textarea's content and then have
the browser pretend they aren't there.
--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 23 '05 #2

P: n/a
Thought something like that.
Was hoping there was a way to remove the "<pre>" behavior of a textarea.
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.