About Custom Table in Sun Editor

705 views Asked by At

enter image description here

I have added a custom table plugin for using different class names and styling. But when I add a new table to the table first it don't gives an error but just add <table class="custom-table"><tbody></tbody></table> without tr and td in the second time I try it gives this error.

When I try to solve, I realize that x and y are coming undefined. I think there is a problem.

  1. I have added '<select class="" id="myClass" name="option"><option value="se-table-default">Default</option><option value="borderless-table">Border Less</option><option value="inner-borders-table">Inner Borders</option><option value="hide-vertical-lines-table">Hide Vertical Lines</option></select>' + this to popup and
  2. this part let myClass = document.getElementById("myClass"); myClass = myClass.value.replace(/\s/g, "") || "se-table-default"; const oTable = this.util.createElement("TABLE"); to get define class of table.

You can find the codes https://codesandbox.io/s/customtableplugin-xv5v31?file=/src/components/Editor.js here. How can solve this problem? Thanks in advance.enter image description here

0

There are 0 answers