0

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

4

1 回答 1

0

您必须config.xml像这样在文件 中进行更改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%";
      }
});

希望这可以帮助!

于 2017-02-07T07:31:11.880 回答