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.

example

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

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

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

Attributes:

NonCopyable
true

Data Types: char | string

Tag for this PPT API object, specified as a character vector or string scalar. A session-unique tag is generated 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.

Specifying your own tag value can help you to identify where issues occur during presentation 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