tab size in a TEXTAREA

R

Rob

Hello all,

Is it possible to change the tabsize in a textarea element?

thnks in advance

Rob
 
J

Jukka K. Korpela

Rob said:
Is it possible to change the tabsize in a textarea element?

The question is quite ambiguous and vague, but the correct answer is
"No, and you should reconsider what you are really doing, since you
asked." The odds are that you are trying to use an input field to
present some legalese to lusers in a stamp-size scrollable window.
(Maybe not, but the lack of information points that direction.)

P.S. The principle that replies should primarily be posted to the group
is no excuse for using a forged From field.
 
Joined
Jun 13, 2008
Messages
1
Reaction score
0
his question was fine

I second the gentleman's question, and I didn't find it ambiguous or poorly worded at all.

When you display a tab character in a textarea, like they do at http://sortmylist.com for example, it's always 8 characters.

I'm working on a web app where I display text that includes tabs in a textarea, and would like them to be 12 characters.

Does anybody know of a way to do this?
 
Joined
Jan 29, 2011
Messages
1
Reaction score
0
You can change the tab size using CSS:
developer.mozilla.org/en/CSS/-moz-tab-size

For example, add this style declaration to the style sheet of your webpage:
textarea, pre { -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; }

This will set the tab size for all textarea and pre elements on your web page. This is supported in Firefox 4.0+ and Opera 10.6+.

On the other hand, if you would like to set a custom tab size for yourself (on *all* web pages) in Firefox 4+, then you should create a user style declaration to set your personal tab size.

Here is some information from Mozilla, although I haven't tried this myself:
mozilla.org/unix/customizing.html#usercss

Your custom style rule might look something like this:
textarea, pre { -moz-tab-size:4 !important; tab-size:4 !important; }
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top