Enum VerticalAlignment

VerticalAlignment

枚举受支持的垂直对齐类型。

若要调用枚举,您可以调用其父类、名称和属性。例如 DocumentApp.VerticalAlignment.BOTTOM

使用 VerticalAlignment 枚举设置表格单元格的垂直对齐方式。

var body = DocumentApp.getActiveDocument().getBody();

// Append table containing two cells.
var table = body.appendTable([['Top', 'Center', 'Bottom']]);

// Align the first cell's contents to the top.
table.getCell(0, 0).setVerticalAlignment(DocumentApp.VerticalAlignment.TOP);

// Align the second cell's contents to the center.
table.getCell(0, 1).setVerticalAlignment(DocumentApp.VerticalAlignment.CENTER);

// Align the third cell's contents to the bottom.
table.getCell(0, 2).setVerticalAlignment(DocumentApp.VerticalAlignment.BOTTOM);

属性

媒体资源类型说明
BOTTOMEnum底部对齐选项。
CENTEREnum居中对齐选项。
TOPEnum顶部对齐选项。