javascript - CKEDITOR Support for Bootstrap Table -
I want to add support for CKEDITOR v4.0 for bootstrap tables. But it can also come under a more general styling position.
I have enabled tables in the Ceciditor and want to assign a custom class to any table generated in the editor. For example: should be created: How can I go about doing this with tables in CKEDITOR? I have tried to use the data processor found in documents, although they do not work for table elements. if you want You can add the styles.js file to your ckeditor folder to be able to convert the user from within the editor to the class of the table: & lt; Table & gt; & Lt; Thead & gt; & Lt; TR & gt; ...
& lt; Table class = "table" & gt; & Lt; Thead & gt; & Lt; TR & gt; ...
CKEDITOR.replace (myElement, {... on: {loaded: function (e) {var rule = {element: {table: function (element) {// Add bootstrap table class to ckeditor table $ (element) AddClass ('table');}}}; e.editor.dataProcessor.dataFilter.addRules (rules); e.editor.dataProcessor HtmlFilter.addRules (rule );}}});
{name: 'My Table Class', Element: 'table', attributes: {'class': 'myTableClass'}}
Comments
Post a Comment