지원되는 가로 정렬 유형을 열거합니다.
enum을 호출하려면 상위 클래스, 이름, 속성을 호출합니다.
DocumentApp.HorizontalAlignment.LEFT
을 예로 들 수 있습니다.
HorizontalAlignment
열거형을 사용하여 Paragraph
콘텐츠의 정렬을 조작합니다.
var body = DocumentApp.getActiveDocument().getBody(); // Insert a paragraph and a table at the start of document. 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);
속성
속성 | 유형 | 설명 |
---|---|---|
LEFT | Enum | 왼쪽 정렬 옵션입니다. |
CENTER | Enum | 가운데 정렬 옵션입니다. |
RIGHT | Enum | 오른쪽 정렬 옵션입니다. |
JUSTIFY | Enum | 양쪽 맞춤 옵션입니다. |