var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();
// Insert a paragraph and a table at the start of the tab.
var par1 = body.insertParagraph(0, "Center");
var table = body.insertTable(1, [['Left', 'Right']]);
var par2 = table.getCell(0, 0).getChild(0).asParagraph();
var par3 = table.getCell(0, 0).getChild(0).asParagraph();
// Center align the first paragraph.
par1.setAlignment(DocumentApp.HorizontalAlignment.CENTER);
// Left align the first cell.
par2.setAlignment(DocumentApp.HorizontalAlignment.LEFT);
// Right align the second cell.
par3.setAlignment(DocumentApp.HorizontalAlignment.RIGHT);
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-09-12 (世界標準時間)。"],[[["`HorizontalAlignment` is used to set the horizontal alignment of paragraph content within Google Docs."],["It provides options for left, center, right, and justify alignment through its properties (`LEFT`, `CENTER`, `RIGHT`, `JUSTIFY`)."],["You can access these alignment options using the syntax `DocumentApp.HorizontalAlignment.ALIGNMENT_TYPE`, where `ALIGNMENT_TYPE` is one of the properties mentioned above."]]],[]]