I am trying to set up the default properties of table that is created inside CKEditor.
For example is there a way to make sure that the attribute border is 0 not 1, or the width is by default set to 100%.
Here you go. dialogDefinition
event solves the problem:
CKEDITOR.on( 'dialogDefinition', function( ev ) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if ( dialogName == 'table' ) {
var info = dialogDefinition.getContents( 'info' );
info.get( 'txtWidth' )[ 'default' ] = '100%'; // Set default width to 100%
info.get( 'txtBorder' )[ 'default' ] = '0'; // Set default border to 0
}
});
CKEDITOR.replace( 'editor1' );
More to read:
Have fun!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With