slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.14k stars 3.35k forks source link

Table in 2.0.2 #4310

Open npcole opened 2 months ago

npcole commented 2 months ago

I understand that Quill 2.0 includes a table module -- but is there a UI to go with that?

I've tried activating the module with table = True -- but I can't find any documentation on the module or how to get the toolbar to show the controls for it. Has anyone had more luck?

patrick-hertling commented 1 month ago

+1

ThanosAlmighty commented 1 month ago

I'm also curious about this. This is one of the features I've most been anticipating as we have many use cases for it. As of now, there is absolutely no documentation on it :(

stsrki commented 1 month ago

+1 for this also.

Would be great to at least have a documented API that we can use in case we want to build the UI ourselves.

stsrki commented 1 month ago

PS. for anyone who needs it. This is how you access the API

const toolbar = quill.getModule('toolbar');

if (toolbar) {
    toolbar.addHandler('table', () => {
        var table = quill.getModule('table');

        if (table) {
            table.insertTable(3, 3);
        }
    });
}
volser commented 1 month ago

getModule('table') is an old module, new one is tableEmbed

stsrki commented 1 month ago

getModule('table') is an old module, new one is tableEmbed

Can you explain how I register tableEmbed? Because whatever I try when I do the var table = quill.getModule('table-embed'); it returns undefined.

stsrki commented 1 month ago

getModule('table') is an old module, new one is tableEmbed

Can you explain how I register tableEmbed? Because whatever I try when I do the var table = quill.getModule('tableEmbed'); it returns undefined.

Trexology commented 1 month ago

import Quill from 'quill';

const quill = new Quill(#${props.name}, { theme: 'snow', modules: { table: true, toolbar: { container: toolbar, handlers: handlers, }, } });

but always get error "quill Cannot import modules/table. Are you sure it was registered?"

did i missed importing something?

attoae commented 1 month ago

Maybe you can try quill table better