Main Content

mlreportgen.ppt.TableRow Class

Namespace: mlreportgen.ppt

Description

Use an object of the mlreportgen.ppt.TableRow class to include a row in a table in a PPT API presentation.

To add content to a table row, append mlreportgen.ppt.TableEntry objects to the row.

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

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

tableRowObj = mlreportgen.ppt.TableRow creates an empty TableRow object.

example

Properties

expand all

Row height, specified as a character vector or string scalar that consists of a number followed by a unit of measurement. For example, '2in' specifies 2 inches. Valid abbreviations are:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

If the table height is specified and the row height is not specified for any row, the height of all the rows is the same. The row height is determined by dividing the table height by the number of rows. If the height is specified for at least one row, the PPT API ignores the table height. Microsoft® PowerPoint® determines the height of the rows for which the height is not specified.

Font family for row text, specified as a character vector or string scalar. Specify a font that appears in the font list in Microsoft PowerPoint. To see the font list, in PowerPoint, on the Home tab, in the Font group, click the arrow to the right of the font.

Font family for complex scripts, specified as a character vector or string scalar. Specify a font family to use when substituting in a locale that requires a complex script, such as Arabic or Asian, for rendering text.

Font color of row text, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.

Font size of row text, specified as a character vector or string scalar that consists of a number followed by a unit of measurement. For example, '11pt' specifies 11 points. Valid abbreviations are:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Background color of the row, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.

Table row formatting, specified as a cell array of PPT format objects. Formats that do not apply to a TableRow object are ignored.

Child elements of mlreportgen.ppt.TableRow object, specified as a cell array of PPT API objects.

Attributes:

NonCopyable
true

Parent of this object, specified as a PPT API object. A PPT API object must only have one parent.

Attributes:

SetAccess
private
NonCopyable
true

Object identifier for the mlreportgen.ppt.TableRow 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.TableRow 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

Methods

expand all

Examples

collapse all

Create a table for a presentation by adding entries to rows and the rows to a table.

Create a presentation.

import mlreportgen.ppt.*
ppt = Presentation('myTableRowPresentation.pptx');
open(ppt);

Add a slide to the presentation.

add(ppt,'Title and Content');

Create a table.

table = Table();

Create the first table row.

tr1 = TableRow();
tr1.Style = [tr1.Style {Bold(true)}];

Create the table entries for the first row.

te1tr1 = TableEntry();
p = Paragraph('first entry');
p.FontColor = 'red';
append(te1tr1,p);
append(tr1,te1tr1);

te2tr1 = TableEntry();
append(te2tr1,'second entry');
append(tr1,te2tr1);

te3tr1 = TableEntry();
te3tr1.FontColor = 'green';
append(te3tr1,'third entry');
append(tr1,te3tr1);

Append the first table row to the table.

append(table,tr1);

Create the second table row, append the table entries to the row, and append the row to the table.

tr2 = TableRow();
te1tr2 = TableEntry();
te1tr2.FontColor ='red';
p = Paragraph('first entry');
append(te1tr2,p);
append(tr2,te1tr2);

te2tr2 = TableEntry();
append(te2tr2,'second entry');
append(tr2,te2tr2);

te3tr2 = TableEntry();
te3tr2.FontColor = 'green';
append(te3tr2,'third entry');
append(tr2,te3tr2);
append(table,tr2);

Add the table to the presentation.

contents = find(ppt,'Content');
replace(contents(1),table);
 

Close and view the presentation.

close(ppt);
rptview(ppt);

Here is the table in the generated presentation:

Version History

Introduced in R2015b