Adds a new table to the end of the document.
class DocumentApp method .appendTable()
DocumentApp is the Apps Script service.
.appendTable() is the method name you will see after a dot in your code.
What it does
Why it's used
- Drop a pricing or inventory table into a report doc.
- Export sheet rows as a formatted table in one step.
Common errors
- Forgetting parentheses on appendTable. Write DocumentApp.appendTable(), not DocumentApp.appendTable or appendTable by itself.
- Skipping dots between chained calls. Each step needs a dot, like DocumentApp.getActiveDocument().getBody().appendTable().
- Adding spaces where they do not belong. Write DocumentApp.appendTable(), not DocumentApp .appendTable(), DocumentApp.appendTable (), or DocumentApp . appendTable().
- Wrong capitalization. Use DocumentApp and appendTable, not documentapp or appendtable.
Explore
Related methods
-
.appendParagraph()
Adds a new paragraph to the end of the document.
-
.create()
Creates a new blank Google Doc.
-
.setText()
Replaces the text content of a document element.
-
.getBody()
Returns the main body section of the document for editing.
-
.openById()
Opens an existing Google Doc by its file ID.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about DocumentApp.appendTable().
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →