Adding class in table in ckeditor for rails application

让人想犯罪 __ 提交于 2019-12-11 20:20:44

问题


I want to add a class named "table" to the table that is created by default. I also want to change the value of border from table dialogue box of ckeditor. I am in big trouble.


回答1:


I got the answer:

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

  if (dialogName === 'table') {
    var addCssClass = dialogDefinition.getContents('advanced').get('advCSSClasses');
    addCssClass['default'] = 'table-class';
  }
});


来源:https://stackoverflow.com/questions/10592482/adding-class-in-table-in-ckeditor-for-rails-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!