0

I'm merging two Google Docs together, by appending each of the elements from one document to the other. This works great, except for when I use appendTable() I'm getting an extra blank line after each table. After some digging, I discovered that this is actually a blank paragraph element.

In trying to remove this blank paragraph I thought maybe I could, after appending the table, remove the next sibling, like so:

var table = body.appendTable(element);
body.removeChild(table.getNextSibling());

However, I'm greeted with a, Can't remove the last paragraph in a document section. message when I try this method.

Has anyone else figured out a way to remove this blank paragraph after using appendTable()?

stmcallister
  • 1,682
  • 1
  • 12
  • 21
  • 1
    You have to do it in a second step ( when it's not the last element anymore) by removing all empty paragraphs. Btw, have you seen this post? http://stackoverflow.com/questions/10939031/how-to-delete-blank-pages-in-a-multipage-document – Serge insas Nov 26 '14 at 18:59

1 Answers1

0

Developers documentations says that a Google Doc can't end with a paragraph, so one will always be automatically inserted.