CKEditor

by mlsteeves

HTML

<script src="http://ckeditor.com/apps/ckeditor/4.0/ckeditor.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css">
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script>
<h3>CKEditor 4:</h3>

<textarea id="editor1"></textarea>

JavaScript

CKEDITOR.on("dialogDefinition", function(ev){
    // Take the dialog name and its definition from the event
    // data.
    var dialogName = ev.data.name;
    var dialogDefinition = ev.data.definition;
    
    // Check if the definition is from the dialog we're
    // interested on (the "Table" dialog).
    if ( dialogName == 'table' )
    {
        // Get a reference to the "Table Info" tab.
        var infoTab = dialogDefinition.getContents( 'info' );
        txtWidth = infoTab.get( 'txtWidth' );
        txtWidth['default'] = "100%";
    }
});

CKEDITOR.replace('editor1');