Enum VerticalAlignment  |  Apps Script  |  Google for Developers (original) (raw)

垂直对齐

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

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

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

const body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Append table containing two cells. const 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);

属性

属性 类型 说明
BOTTOM Enum 底部对齐选项。
CENTER Enum 居中对齐选项。
TOP Enum 顶部对齐选项。

如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。

最后更新时间 (UTC):2024-12-22。