mlreportgen.ppt.ColSpec class
Package:mlreportgen.ppt
Formatting for table column
Description
Formatting for a table column.
Construction
创建一个空表列规范。colSpecObj
= ColSpec()
creates a column specification having the specified width.colSpecObj
= ColSpec(colWidth)
Input Arguments
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
— centimetersin
— inches毫米
— millimeterspi
— picaspt
— pointspx
— pixels
Output Arguments
colSpecObj
— Table column formattingmlreportgen.ppt.ColSpec
object
Table column formatting, returned as anmlreportgen.ppt.ColSpec
目的。
Properties
Id
—ID 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.
Tag
—Tag 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班级号
, whereCLASS
is the object class andID
是Id
属性目的。
指定您自己的标签值的原因的一个示例是使更轻松地确定在演示文稿生成过程中发生的问题的位置。
Width
—Column widthstring
Width of table column, specified as a string.
The string must have the formatvalueUnits
where单位
is an abbreviation for the units in which the width size is expressed. Valid abbreviations are:
不abbreviation — pixels
cm
— centimetersin
— inches毫米
— millimeterspi
— picaspt
— pointspx
— pixels
Bold
—Option to use bold for text逻辑价值
将BOLD用于文本的选项,指定为逻辑。要使文本粗体,请将此属性设置为真的
或者1
. Setting theBold
property adds a correspondingmlreportgen.ppt.bold
format object to theStyle
property of this presentation element. Removing theBold
属性设置删除对象。
Data Types:logical
Font
—Default 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.
ComplexScriptFont
—Font 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.
FontColor
—Font 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'
指定蓝色。
FontSize
—Font 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
— centimetersin
— inches毫米
— millimeterspi
— picaspt
— pointspx
— pixels
Italic
—Option to use italics for text[]
(默认)|逻辑价值
Option to use italics for text, specified as a logical. Set this property to真的
. Setting theItalic
property adds a correspondingmlreportgen.ppt.Italic
format object to theStyle
property of this presentation element. Removing theItalic
属性设置删除对象。
Data Types:logical
Examples
Set Table Column Formatting
创建演示文稿并添加幻灯片。
importmlreportgen.ppt.*slides = Presentation('mycolspec.pptx');tableslide = add(幻灯片,'Title and Content');
创建一个表。创建一个ColSpec
object with a specified width for the first two columns of the table. Specify the背景颜色
两者的财产ColSpec
objects. Set theColSpecs
属性Table
objectt
to 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
介绍。(这winopen
code works on Windows®platforms.)
replace(slides,'Content',t);关闭(幻灯片);ifispc winopen(slidesFile);end
Related Examples
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- AméricaLatina(Español)
- Canada(English)
- United States(English)
欧洲
- Belgium(English)
- 丹麦(English)
- Deutschland(德意志)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)