最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I initialize table in quill js 2.0.? - Stack Overflow

programmeradmin3浏览0评论

How can I initialize table in quill js 2.0.?

I've tried by using table keyword in toolbar it shows table icon but I could not create the table.

How can I initialize table in quill js 2.0.?

I've tried by using table keyword in toolbar it shows table icon but I could not create the table.

Share Improve this question edited Sep 14, 2018 at 12:25 Ivar 6,81812 gold badges56 silver badges67 bronze badges asked Sep 14, 2018 at 12:22 Agustine RajAgustine Raj 1811 gold badge1 silver badge5 bronze badges 1
  • Did you ever find a solution that allowed you to use the table module from controls in the toolbar? – Jason Wood Commented Jun 13, 2020 at 15:17
Add a comment  | 

2 Answers 2

Reset to default 8

Try to provide table module when creating your editor like this:

var editor = new Quill( '#editor', {
    theme: 'snow',
    modules: {
        table: true
    }
} );

And then just reference table module:

const table = editor.getModule('table');

Using table variable you can trigger different methods for tables:

table.insertTable(2, 2);

Full example can be found here: https://codepen.io/quill/pen/QxypzX

I really like the extensibility of Quill a lot. I implement a module quill-better-table to add support for tables. Hope that quill-better-table could help someone who need to edit/render table in quilljs. Requirements: quill.js v2.0.0-dev.3

发布评论

评论列表(0)

  1. 暂无评论