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 as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "10px" specifies 10 pixels. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

Properties

expand all

Width of column, specified as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "10px" specifies 10 pixels. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Tag, 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. Use this value to help identify where an issue occurs during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, 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:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

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