ספירה של סוגי ההתאמה האופקית הנתמכים.
כדי לקרוא למאפיין enum, צריך לקרוא לכיתה ההורה, לשם ולנכס שלו. לדוגמה,
DocumentApp.HorizontalAlignment.LEFT.
אפשר להשתמש בספירה Horizontal כדי לשנות את היישור של תוכן 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);
מאפיינים
| נכס | סוג | תיאור |
|---|---|---|
LEFT | Enum | האפשרות 'יישור לשמאל'. |
CENTER | Enum | האפשרות 'יישור למרכז'. |
RIGHT | Enum | האפשרות 'יישור לימין'. |
JUSTIFY | Enum | אפשרות היישור justify. |