After incorporating ckeditor into my web page along with the table plugin, I noticed that sometimes the width of tables created in the editor window extends beyond the boundaries of the webpage when displayed. To address this issue, I made some adjustments to allow style tags:
CKEDITOR.replace('editor', {
extraAllowedContent: 'table{*}'
});
In addition, I modified ckeditor's config.js to set the default table width to 100%:
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%';
}
});
However, I have encountered difficulty in setting the table layout to fixed, which would ensure that the table maintains a 100% width on the webpage regardless of its content.