主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

mlreportgen.ppt.VAlign 类

命名空间: mlreportgen.ppt

表条目内容的垂直对齐

描述

表条目内容的垂直对齐。

mlreportgen.ppt.VAlign 类是一个 handle 类。

创建对象

描述

vAlignObj = VAlign 创建一个具有值的垂直对齐对象 "top"

vAlignObj = VAlign(value) 创建具有指定值的垂直对齐对象。

示例

输入参量

全部展开

表条目内容的垂直对齐方式,指定为以下值之一:

描述

"top"

垂直对齐至顶部

"bottom"

垂直对齐到表条目的底部

"middle"

垂直对齐到表条目的中间

"topCentered"

垂直对齐到表条目的顶部,水平对齐到表条目的中心

"bottomCentered"

垂直对齐到表条目的底部,水平对齐到表条目的中心

"middleCentered"

垂直对齐到中间,水平对齐到表条目的中心

属性

全部展开

表条目内容的垂直对齐,指定为字符向量或字符串标量。

描述

"top"

垂直对齐至顶部

"bottom"

垂直对齐到表条目的底部

"middle"

垂直对齐到表条目的中间

"topCentered"

垂直对齐到表条目的顶部,水平对齐到表条目的中心

"bottomCentered"

垂直对齐到表条目的底部,水平对齐到表条目的中心

"middleCentered"

垂直对齐到中间,水平对齐到表条目的中心

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

标记,指定为字符向量或字符串标量。PPT API 在创建此对象的过程中生成一个会话唯一标记。生成的标记形式为 CLASS:ID,其中 CLASS 是对象类,ID 是对象的 Id 属性的值。使用此值来帮助确定在文档生成过程中出现的问题的位置。

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

目标标识符,指定为字符向量或字符串标量。PPT API 在创建文档元素对象时会生成一个会话唯一标识符。您可以为 Id 指定自己的值。

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

示例

全部折叠

创建演示文稿。

import mlreportgen.ppt.*

ppt = Presentation("myVAlign.pptx");
open(ppt);
slide1 = add(ppt,"Title and Content");

使用元胞数组创建表。设置每个条目的垂直对齐方式。

table1 = Table();
row1 = TableRow();
p1 = Paragraph("top");
r1e1 = TableEntry();
r1e1.Style = {VAlign("top"),FontSize(".5in")};
append(r1e1,p1);
append(row1,r1e1);

p2 = Paragraph("middle");
r1e2 = TableEntry();
r1e2.Style = {VAlign("middle")};
append(r1e2,p2);
append(row1,r1e2);

row2 = TableRow();
p3 = Paragraph("bottom");
r2e1 = TableEntry();
r2e1.Style = {VAlign("bottom")};
append(r2e1,p3);
append(row2,r2e1);

p4 = Paragraph("middle centered");
r2e2 = TableEntry();
r2e2.Style = {VAlign("middleCentered"),FontSize(".5in")};
append(r2e2,p4);
append(row2,r2e2);

append(table1,row1);
append(table1,row2);

将表添加到幻灯片中,生成演示文稿,然后打开 myVAlign 演示文稿。

replace(slide1,"Content",table1);
close(ppt);
rptview(ppt);

Sample presentation slide with a 2x2 table. The top left cell displays as left aligned, and the bottom right cell is middle centered, each in a font of 0.5 inches. The bottom left cell is bottom aligned, and the top right cell is middle aligned, displaying in a smaller font.

版本历史记录

在 R2015b 中推出