简体   繁体   中英

CKeditor Making percentage as default in width

I am using CKeditor, in creating Table by default the width is taking as px. i need only in percentage. Is there any option to make it as percentage always.

for example if i enter the width as 80 it has to take it as 80%. But now it is taking as 80px

You will have to make that change in your config.xml file like this width['default'] = "80%"; ,

CKEDITOR.on('dialogDefinition', function( ev ) {
      var diagName = ev.data.name;
      var diagDefn = ev.data.definition;

      if(diagName === 'table') {
        var infoTab = diagDefn.getContents('info');

        var width = infoTab.get('txtWidth');
        width['default'] = "80%";
      }
});

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM