Open Mizan-Rifat opened 3 weeks ago
I have created a custom Plugin to create a borderless table. Here is my implementation:
import { ButtonView, Plugin } from 'ckeditor5'; export class BorderlessTable extends Plugin { init() { const editor = this.editor; editor.ui.componentFactory.add('borderlessTable', locale => { const view = new ButtonView(locale); view.set({ label: 'Make Table Borderless', icon: '<svg>...</svg>', tooltip: true }); view.on('execute', () => { console.log({ editor }); const selection = editor.model.document.selection; const table = selection.getSelectedElement(); if (table && table.is('element', 'table')) { editor.model.change(writer => { writer.setAttribute('class', 'borderless-table', table); }); } }); return view; }); } }
It should add the borderless-table class in the selected table.
No class is added.
I have the same problem. Can anyone tell me something about it? My code is almost identical, am I doing something wrong? This can't be so hard.
I have created a custom Plugin to create a borderless table. Here is my implementation:
✔️ Expected result
It should add the borderless-table class in the selected table.
❌ Actual result
No class is added.