Insert table from gmail to google spreadsheet by google script
<p>I recive an email with table many times in one day it can be 10x2 or 40x2 or something like this. Every time I need to paste this table in sheet start from cell A1/ Now I have this code, but it paste whole table to cell A1:</p>

<pre><code>var SEARCH_QUERY = "label:inbox is:unread to:me subject:importnumbers";

// Credit: https://gist.github.com/oshliaer/70e04a67f1f5fd96a708

function getEmails_(q) {
    var emails = [];
    var threads = GmailApp.search(q);
    for (var i in threads) {
        var msgs = threads[i].getMessages();
        for (var j in msgs) {
            emails.push([msgs[j].getBody().replace(/&lt;.*?&gt;/g, '\n')
                .replace(/^\s*\n/gm, '').replace(/^\s*/gm, '').replace(/\s*\n/gm, '\n')
            ]);
        }
    }
    return emails;
}  
  function appendData_(sheet, array2d) {

      sheet.getRange(1, 1).setValues(array2d);
      }

    function saveEmails() {
        var array2d = getEmails_(SEARCH_QUERY);
        if (array2d) {
            appendData_(SpreadsheetApp.getActiveSpreadsheet().getSheetByName('numberlist'), array2d);
        }
      markArchivedAsRead ();
    }

    function markArchivedAsRead() {
      var threads = GmailApp.search('label:inbox is:unread to:me subject:importnumberlist');
      GmailApp.markThreadsRead(threads);
    };
</code></pre>

<p>Please, help me to paste table with right dimensions.</p>