soccerloway / quill-better-table

Module for better table in Quill, more useful features are supported.
MIT License
313 stars 120 forks source link

inserting <p> tag instead of table #44

Closed sunilpune closed 4 years ago

sunilpune commented 4 years ago

APP.COMPONENT.TS

`import {Component, OnInit, AfterViewInit, ViewChild, ElementRef} from '@angular/core';

import QuillBetterTable from 'quill-better-table';

declare const Quill: any;

@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.less'] }) export class AppComponent implements OnInit, AfterViewInit { @ViewChild('editable', {static: true}) editRef: ElementRef;

quill: any;

ngOnInit() { setTimeout(() => { this.initEditor(); }, 1000); }

initEditor(): void { Quill.register({ 'modules/better-table': QuillBetterTable }, true); // tslint:disable-next-line:no-unused-expression this.quill = new Quill(this.editRef.nativeElement, { theme: 'snow', modules: { table: false, 'better-table': { operationMenu: { items: { unmergeCells: { text: 'Another unmerge cells name' } } } }, keyboard: { bindings: QuillBetterTable.keyboardBindings } } } ); } ngAfterViewInit() { }

onInsertTable() { const tableModule = this.quill.getModule('better-table'); tableModule.insertTable(3, 3); } } `

Untitled

its showing me above error if quill not installed and after installing quill with npm, code is working fine but only inserting <p> tag (paragraph tag) multiple times.

soccerloway commented 4 years ago

image

akshaya-a-p commented 1 year ago

I'm working in React JS apps, <p> tags are adding instead of table. I tired exposing quill js file in index.html file. but still facing same issue. Can I get help in resolving this issue