MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看最新英文版本。
类: mlreportgen.ppt.Table 命名空间: mlreportgen.ppt
将行追加到表格
rowObj = append(table,row)
rowObj = append(table,row) 将一行追加到表中。
rowObj
table
row
示例
全部展开
创建演示文稿。
import mlreportgen.ppt.* ppt = Presentation("myTableEntryPresentation.pptx"); open(ppt); add(ppt,"Title and Content");
创建一个包含三列的表。
table1 = Table();
创建第一个表行。
tr1 = TableRow(); tr1.Style = {Bold(true)};
为第一行创建三个表条目。
te1tr1 = TableEntry(); p = Paragraph("first entry"); p.FontColor = "red"; append(te1tr1,p); te2tr1 = TableEntry(); append(te2tr1,"second entry"); te3tr1 = TableEntry(); te3tr1.Style = {FontColor("green")}; append(te3tr1,"third entry");
将表条目追加到第一行。
append(tr1,te1tr1); append(tr1,te2tr1); append(tr1,te3tr1);
创建第二个表行。
tr2 = TableRow();
为第二行创建三个表条目。
te1tr2 = TableEntry(); te1tr2.Style = {FontColor("red")}; p = Paragraph("first entry"); append(te1tr2,p); te2tr2 = TableEntry(); append(te2tr2,"second entry"); te3tr2 = TableEntry(); te3tr2.Style = {FontColor("green")}; append(te3tr2,"third entry");
将表条目追加至第二行。
append(tr2,te1tr2); append(tr2,te2tr2); append(tr2,te3tr2);
将表行追加到表中。
append(table1,tr1); append(table1,tr2);
使用 mlreportgen.ppt.Presentation.find 方法查找具有 Content 占位符的幻灯片。在这种情况下,有两个。
mlreportgen.ppt.Presentation.find
Content
contents = find(ppt,"Content");
将第二张幻灯片中的表替换为 table1。
table1
replace(contents(1),table1);
生成演示文稿。打开 myTableEntryPresentation.pptx。在 Windows® 平台上,您可以在 MATLAB® 中打开演示文稿:
myTableEntryPresentation.pptx
close(ppt); rptview(ppt);
mlreportgen.ppt.Table
要追加行的表,指定为 mlreportgen.ppt.Table 对象。
mlreportgen.ppt.TableRow
要追加到表中的行,指定为 mlreportgen.ppt.TableRow 对象。
mlreportgen.dom.TableRow
追加的表行,作为 mlreportgen.dom.TableRow 对象返回。
在 R2015b 中推出
mlreportgen.ppt.Table | mlreportgen.ppt.TableRow | mlreportgen.ppt.TableEntry
mlreportgen.ppt.TableEntry
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处