How do I get tab spaces to work in CKEditor?

ckeditor config
how to add tab in ckeditor
ckeditor5 tab
ckeditor documentation

Is it possible to get CKEditor to recognize tab as a feature inside the editor, especially when in source code mode? Right now, when I hit the tab key, the cursor goes to the next field on the page.

I'd like to get the tab character working so CKEditor can work more like a code editor in which I can format my markup with tab spaces.

I'd really appreciate any help I can get with this.

I'm using CKEDitor 4.0.1

Or, perhaps this feature is supported in one of the newer versions of CKEditor?

This link might help: http://get-simple.info/forums/showthread.php?tid=1347

Basically, just add

config.tabSpaces = 4; // or some other value

to config.js and every time Tab is hit, you get that number of spaces.

Tab as indent, Hi, I am new to CKEditor, but have this peculiar user requirement.How can I implement the tab keystroke as an indent (like in Microsoft word)  1. The code is config.tabSpaces = 4;if you are saving to config.js. If you are setting configurations inside the file, the code will be as follows: var editor = CKEDITOR.replace( 'editor1', { tabSpaces: 4}); it should be noticed, as Kamil Sama commented in rvighne answer, that this requires the tab plugin: tab plugin.

The code is config.tabSpaces = 4; if you are saving to config.js. If you are setting configurations inside the file, the code will be as follows:

var editor = CKEDITOR.replace( 'editor1', {
    tabSpaces: 4
});

it should be noticed, as Kamil Sama commented in rvighne answer, that this requires the tab plugin: tab plugin

#2740 (Allow tab character to be inserted) – CKEditor, Add a new setting so that the tab character can actually be inserted in to rich or important at the moment thus we won't be working on it in the nearest future. When pasting data into the editor, tab characters don't get converted properly to spaces. Firefox seems to work well, and IE sort of works, here's the results: Browser (Browser Version) - Spaces Per Tab Character

<textarea name="text_note" id="text_note"> </textarea> 


 <!-- tabSpaces:4 add this in your script like as bellow code.-->

  <script type="text/javascript">
    CKEDITOR.replace('text_note',{tabSpaces:4});
 </script>

Tab Key Handling, This plugin provides basic Tab/Shift-Tab key handling with the following behaviors: Move to next/previous table cell, if within a table Move to  Add a new setting so that the tab character can actually be inserted in to rich text mode instead of X spaces. Many ways to do it such as: FCKConfig.TabSpaces = -1; shows tab FCKConfig.TabSpaces = 0; disables tab FCKConfig.TabSpaces = 1+; shows spaces instead of tab. or add a whole new setting FCKConfig.TabShow = true; show tabs instead of spaces. Personally i do not like spaces, i prefer tabs since i have much more flexibility over them server side than spaces.

If you using inline element, you can use like this

var editor2 = CKEDITOR.inline( 'your div id', { tabSpaces : 5, });

Enable "tab" key · Issue #1197 · ckeditor/ckeditor5 · GitHub, when ckeditor5 will release their official tab key feature ? GitHub is home to over 50 million developers working together to host and review it would be better if we change/set/enable the default white space setting to pre  State in CKEditor 4: lots of unwanted &nbsp; in the data and inside editable due to issues which I explained in this answer.The problem is that we would need to constantly normalise white spaces and it would be nearly impossible to understand whether already existing &nbsp; should be replaced with a normal space or not when user types the next characters or pastes, etc.

CKeditor: Skins, & Tab spaces Indenting:, In CKeditor's config.js there is this line that sets the tab spaces: config. Are skin changes and tab space changes working for anyone else? I'm using CKEditor 4.2 with D7 and the editor is replacing every space with an HTML non-breaking space. For instance, if I type: This is a paragraph and then either save or view source, I'll get the following: <p>This&nbsp;is&nbsp;a&nbsp;paragraph.</p>

ckeditor/ckeditor5, As we didn't support tab character yet, it might be that all tabs are converted to ( single) spaces. _ If you have a better idea how that could work, let us know. Since CKEditor, it is not possible to insert non-breakable spaces anymore like it used to be in FCKeditor. In FCKeditor, it was possible to add a non-breakable space pressing Shift + Space or Alt + 0160. In CKEditor, this is not possible any longer. I consider this as a bug as it is a regression.

CKEditor Tab Key inserts tab spaces, The Tab Key in the CKEditor naturally does not insert tab characters, instead it behaves like controls on a web page and is used to change  The user types a space, or sometimes a new line, and in the database the text is saved as <p> </p> (the space in between the paragraph tags seems to be a "tab" space. CKEditor does not seem to know how to parse the empty space, so it is replaced with an unknown character (the diamond with the question mark) which, when saved, is replaced in the

Comments
  • Perhaps this will help: get-simple.info/forums/showthread.php?tid=1347
  • Thanks rvighne. That did the trick! I added config.tabSpaces = 4; to my config.js file. Works like a charm.
  • That works but the editor doesn't allow "real" tabs. For example, when you hit the same number of tabs on different lines containing text the two lines are not correctly aligned (even when using space/back-space).
  • Should be noted that this requires installing tab plugin ckeditor.com/addon/tab