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