Hi All. I am creating a plugin.
Idea. In textarea, on dialog window, i insert text on the following pattern:
property1:value1; property2:value2; property3:value3;
Then i press button Ok, and ta-da
property1 | value1 |
property2 | value2 |
property3 | value3 |
I have a simple and fast table.
I have next code
onOk: function() { var dialog = this; var contentFromTextarea = dialog.getValueOf('tab-main','content'); var rowArray = new Array(); var cellArray = new Array(); var row = ''; rowArray = contentFromTextarea.split(';'); for (var i = 0; i < rowArray.length-1; i++) { cellArray[i] = rowArray[i].split(':'); row += '<tr>' + '<td>' + cellArray[i][0] + '</td>' + '<td>' + cellArray[i][1] + '</td>' + '</tr>' } row = '<table>' + row + '</table>'; editor.insertHtml(row); }
But hi dont insert contents as html. Аnd text wrapped in element "p".
Why it does not work correctly?
Somebody can help me?
Somebody can help me?