-2

In the Stack Overflow text editor we are not able to add tab characters -- pressing Tab will instead switch to the next text field (for entering tags). I checked the CKeditor demo, and it does the same thing. Is it possible for the editor to provide the option to add tab characters within the editor?

3
3

It is probably designed that way. But it does support tabs in a way.

A standard textarea usually doesn't accept tabs without modifications (ex: Javascript: http://ajaxian.com/archives/handling-tabs-in-textareas). The SO site doesn't implement that feature.

But you can copy and paste tabs like here: tab tab tab But they won't show as HTML treats tabs as whitespaces so basically they will appear as spaces.

But here    tab tab taaab   tab will show.

Because code is put in pre (preformated) tags that will display tabulations and will use a fixed width font.

So if you want to display preformated text add 4 spaces at the beginning of each line and there you will have access to tabulations.

2
  • But tab will only be four spaces wide (at least that is what I'm seeing) so you probably want to use two of them.
    – agf
    Oct 3 '11 at 22:12
  • 2
    Yeah... My example didn't work with the word tab followed by an actual tab. But I think the OP is answered none the less an will be happy to tab as much as he likes now... That might have frightening consequences.
    – Coyote
    Oct 3 '11 at 22:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .