Documentation

mlreportgen.ppt.ColSpec class

Package:mlreportgen.ppt

Formatting for table column

Description

Formatting for a table column.

Construction

colSpecObj= ColSpec()创建一个空表列规范。

colSpecObj= ColSpec(colWidth)creates a column specification having the specified width.

Input Arguments

expand all

colWidth— Width of columnstring

Width of column, specified as a string. Use a string having the formatvalueUnits, where单位is an abbreviation for the width units. These abbreviations are valid:

  • no abbreviation — pixels

  • cm— centimeters

  • in— inches

  • 毫米— millimeters

  • pi— picas

  • pt— points

  • px— pixels

Output Arguments

expand all

colSpecObj— Table column formattingmlreportgen.ppt.ColSpecobject

Table column formatting, returned as anmlreportgen.ppt.ColSpec目的。

Properties

expand all

IdID for PPT API objectstring

ID for PPT API object, specified as a string. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

TagTag for this PPT API objectsession-unique tag generated as part of object creation (default) | string

Tag for this PPT API object, specified as a string. The generated tag has the form班级号, whereCLASSis the object class andIDId属性目的。

指定您自己的标签值的原因的一个示例是使更轻松地确定在演示文稿生成过程中发生的问题的位置。

WidthColumn widthstring

Width of table column, specified as a string.

The string must have the formatvalueUnitswhere单位is an abbreviation for the units in which the width size is expressed. Valid abbreviations are:

  • 不abbreviation — pixels

  • cm— centimeters

  • in— inches

  • 毫米— millimeters

  • pi— picas

  • pt— points

  • px— pixels

BoldOption to use bold for text逻辑价值

将BOLD用于文本的选项,指定为逻辑。要使文本粗体,请将此属性设置为真的或者1. Setting theBoldproperty adds a correspondingmlreportgen.ppt.boldformat object to theStyleproperty of this presentation element. Removing theBold属性设置删除对象。

Data Types:logical

FontDefault font for text in columnstring

Default font for text in column, specified as a string. Specify a font that appears in the PowerPoint®list of fonts in theHome标签Fontarea.

ComplexScriptFontFont family for complex scriptsstring

Font family for complex scripts, specified as a string. Specify a font family for substituting in a locale that requires a complex script (such as Arabic or Asian) for rendering text.

FontColorFont color for presentation elementstring

Font color, specified as a string. Use either a CSS color name or a hexadecimal RGB value.

  • 有关CSS颜色名称的列表,请参阅http://www.crockford.com/wrrrld/color.html.

  • To specify a hexadecimal RGB format, use#as the first character and two-digit hexidecimal numbers for each for the red, green, and blue values. For example,'#0000ff'指定蓝色。

FontSizeFont sizestring

Font size, specified as a string. Use the string formatvalueUnits, where单位is an abbreviation for the font size. These abbreviations are valid:

  • no abbreviation — pixels

  • cm— centimeters

  • in— inches

  • 毫米— millimeters

  • pi— picas

  • pt— points

  • px— pixels

ItalicOption to use italics for text[](默认)|逻辑价值

Option to use italics for text, specified as a logical. Set this property to真的. Setting theItalicproperty adds a correspondingmlreportgen.ppt.Italicformat object to theStyleproperty of this presentation element. Removing theItalic属性设置删除对象。

Data Types:logical

Examples

expand all

Set Table Column Formatting

创建演示文稿并添加幻灯片。

importmlreportgen.ppt.*slides = Presentation('mycolspec.pptx');tableslide = add(幻灯片,'Title and Content');

创建一个表。创建一个ColSpecobject with a specified width for the first two columns of the table. Specify the背景颜色两者的财产ColSpecobjects. Set theColSpecs属性Tableobjecttto thecolSpecs, which specifies the formatting for the first two columns.

t =表(魔术(12));t.Style = {halign('center')};ColSpecs(2)= ColSpec('2in');colSpecs(1) = ColSpec('1in');colSpecs(1).BackgroundColor =“红色”; colSpecs(2).BackgroundColor ='green'; t.ColSpecs = colSpecs;

Add the table to the slide, generate the presentation, and open themyColSpec介绍。(这winopencode works on Windows®platforms.)

replace(slides,'Content',t);关闭(幻灯片);ifispc winopen(slidesFile);end

Related Examples

这个话题有帮助吗?