Enum HorizontalAlignment

水平アライメント

サポートされている水平方向の配置タイプの列挙。

列挙型を呼び出すには、その親クラス、名前、プロパティを呼び出します。たとえば、 DocumentApp.HorizontalAlignment.LEFT です。

HorizontalAlignment 列挙型を使用して、Paragraph コンテンツの配置を操作します。

const body =     DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();  // Insert a paragraph and a table at the start of the tab. const par1 = body.insertParagraph(0, 'Center'); const table = body.insertTable(1, [['Left', 'Right']]); const par2 = table.getCell(0, 0).getChild(0).asParagraph(); const 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);

プロパティ

プロパティタイプ説明
LEFTEnum左揃えのオプション。
CENTEREnum中央揃えのオプション。
RIGHTEnum右揃えのオプション。
JUSTIFYEnumjustify-alignment オプション。