Main Content

mlreportgen.ppt.ColWidth Class

Namespace: mlreportgen.ppt

Table column width

Description

Width of a table column.

The mlreportgen.ppt.ColWidth class is a handle class.

Creation

Description

widthObj = ColWidth creates a format object that specifies a column width of 0.25 inches.

widthObj = ColWidth(value) creates a column width object having the specified width.

example

Input Arguments

expand all

Width of column, specified in the form valueUnits, where Units is an abbreviation for the width units. These abbreviations are valid:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Properties

expand all

Object identifier for the mlreportgen.ppt.ColWidth object, specified as a character vector or string scalar. The PPT API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

Tag for the mlreportgen.ppt.ColWidth object, specified as a character vector or string scalar. The PPT API generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

Width of column, specified in the form valueUnits, where Units is an abbreviation for the width units. These abbreviations are valid:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

ppt = Presentation('myColWidth.pptx');
open(ppt);
slide1 = add(ppt,'Title and Content');

Create a table and specify that the first column has a width of four inches.

C = {'wide column' 17 'aaaa' 4 5 6 7 8 9 10 11;...
    'long text string' 'bb' 1 3 5 7 9 11 13 15 17;...
    'more text' 1 2 3 4 5 6 7 8 9 10};

t = Table(C);
t.entry(1,1).Style = {ColWidth('4in')};

Replace the slide content with the table, generate the presentation, and open the myColWidth presentation.

replace(slide1,'Content',t);
close(ppt); 
rptview(ppt);

Version History

Introduced in R2015b