You have two options. You can add the inline style to the instanceReady handler with:
var myStyleSheet = e.editor.document.appendStyleText("body {background:...}");
This adds an empty <style> element to the beginning of the iframed document containing the provided text. The return value is a CSSStyleSheet (browser DOM object), so if you save it somewhere, you can add, delete, or modify style rules using DOM methods from javascript. I'm not sure if they are saved through mode changes (i.e., after double-clicking "Source") or calls to setData (), but you can capture these things with the "mode" and "contentDom" events and reapply the table style in event handler. Note that (at least for the "mode" handler) you need to check that editor.mode==='wysisyg' , because editor.document is null in the original mode.
On the other hand, if you really want to set your inline styles in the <body> editor element, try defining a function:
function setEditorStyle(e) { var ed = e.editor; if (ed.mode!=="wysiwyg") return;
then in your editor configuration you need to add:
..., on: { instanceReady: setEditorStyle, mode: setEditorStyle, ... }, ...
The style will be set both after the first creation of the iframe editor, and after switching to wysiwyg mode (normal editing, not the original mode).
I do not know why your styles are reset by calls to updateElement (); I am doing the same thing (using CKEditor v4), and updateElement () does not support resetting the inline styles set by me to <body> . Perhaps this has changed with the versions of CKeditor. In any case, if this is a problem, you can simply manually create a reset style after calling updateElement (). (I would say, "just call setEditorStyle ()", but as shown above, the function is written to require the event parameter e . Instead, you can rewrite it to use the external variable ed (for example, global var) - i.e. . change
var ed = e.editor;
to
if (!ed) ed = e.editor;
and then you can safely call setEditorStyle () from anywhere in your javascript after the editor has been created.)