Enum HorizontalAlignment

HorizontalAlignment

Una enumeración de los tipos de alineación horizontal admitidos.

Para llamar a una enum, debes llamar a su clase superior, nombre y propiedad. Por ejemplo, DocumentApp.HorizontalAlignment.LEFT.

Usa la enumeración HorizontalAlignment para manipular la alineación del contenido de 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);

Propiedades

PropiedadTipoDescripción
LEFTEnumLa opción de alineación a la izquierda.
CENTEREnumLa opción de alineación central.
RIGHTEnumLa opción de alineación a la derecha.
JUSTIFYEnumLa opción justify-alignment.