mlreportgen.ppt.TableRow class

Package: 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 (MATLAB).

Creation

Description

example

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

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 (default)

  • 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.

  • For a list of CSS color names, see https://www.crockford.com/wrrrld/color.html.

  • To specify a hexadecimal RGB format, use # as the first character and two-digit hexadecimal numbers for the red, green, and blue values. For example, '#0000ff' specifies blue.

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 (default)

  • 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.

  • For a list of CSS color names, see https://www.crockford.com/wrrrld/color.html.

  • To specify a hexadecimal RGB format, use # as the first character and two-digit hexadecimal numbers for the red, green, and blue values. For example, '#0000ff' specifies blue.

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 this object, specified as a cell array of PPT objects. This property is read-only.

Parent of this object, specified as a PPT object. This property is read-only.

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

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 an issue occurred during presentation generation.

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:

Introduced in R2015b