I would like to create a new table element with a custom style and add it to the current cursor position in the document. I saw that you can get the current position with:
var cursor = DocumentApp.getActiveDocument().getCursor();
which returns a Position object. The position class provides a method for adding text to the current position:
cursor.insertText('ΰ² βΏΰ² ');
but from the documentation, I see no way to insert a common element (a table in my case) instead of plain text.
On the other hand, there is a method of the Body class that allows you to add a table to the end of the document, but you cannot specify a custom position.
Can anybody help?
thanks
source share