tab size in a TEXTAREA

Discussion in 'HTML' started by Rob, May 6, 2005.

  1. Rob

    Rob Guest

    Hello all,

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

    thnks in advance

    Rob
    Rob, May 6, 2005
    #1
    1. Advertising

  2. "Rob" <> wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, May 7, 2005
    #2
    1. Advertising

  3. Rob

    extol

    Joined:
    Jun 13, 2008
    Messages:
    1
    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?
    extol, Jun 13, 2008
    #3
  4. Rob

    Jacobian

    Joined:
    Jan 29, 2011
    Messages:
    1
    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; }
    Jacobian, Jan 29, 2011
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Augustus
    Replies:
    1
    Views:
    350
    Ken Schaefer
    Sep 10, 2003
  2. Textarea Inside of a textarea

    , Feb 4, 2006, in forum: ASP General
    Replies:
    6
    Views:
    326
    Anthony Jones
    Feb 5, 2006
  3. J. VerSchave
    Replies:
    4
    Views:
    121
    Yann-Erwan Perio
    Sep 23, 2004
  4. Replies:
    3
    Views:
    89
    Randy Webb
    Aug 13, 2005
  5. Replies:
    1
    Views:
    308
    Bart Van der Donck
    Jul 4, 2007
Loading...

Share This Page