mlreportgen.ppt.TableRow Class
Namespace: mlreportgen.ppt
Table row
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
creates an empty tableRowObj = mlreportgen.ppt.TableRowTableRow object.
Properties
Row height, specified as a character vector or string scalar that contains 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
You can also specify pixels by omitting the unit. For example, "5"
specifies 5 pixels.
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.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Font family for the 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.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
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, to render text.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Font color for the text, specified as a character vector or string scalar that contains a CSS color name or hexadecimal RGB value.
| Format | Value |
|---|---|
| CSS color name | Specify a CSS color name. For a list of CSS color names, see https://www.w3.org/wiki/CSS/Properties/color/keywords. |
| Hexadecimal RGB value | Use the format "#RRGGBB". Use # as the first character and two-digit hexadecimal numbers for the red, green, and blue values. You can use uppercase or lowercase letters. |
Example: "red" specifies a red color using a CSS color name.
Example: "#0000ff" specifies a blue color using a hexadecimal RGB value.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Font size of the text, specified as a character vector or string scalar that contains 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
You can also specify pixels by omitting the unit. For example, "5"
specifies 5 pixels.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Background color, specified as a character vector or string scalar that contains a CSS color name or hexadecimal RGB value.
| Format | Value |
|---|---|
| CSS color name | Specify a CSS color name. For a list of CSS color names, see https://www.w3.org/wiki/CSS/Properties/color/keywords. |
| Hexadecimal RGB value | Use the format "#RRGGBB". Use # as the first character and two-digit hexadecimal numbers for the red, green, and blue values. You can use uppercase or lowercase letters. |
Setting the BackgroundColor property adds a
mlreportgen.ppt.BackgroundColor format object to the
Style property. Setting the BackgroundColor
property to an empty value removes the object.
Example: "red" specifies a red color using a CSS color name.
Example: "#0000ff" specifies a blue color using a hexadecimal RGB value.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Table row formatting, specified as a cell array of PPT format objects.
Formats that do not apply to a TableRow object are
ignored.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Parent of this object, specified as a PPT API object. A PPT API object must only have one parent.
Attributes:
GetAccess | public |
SetAccess | private |
NonCopyable | true |
Child elements of this object, specified as a cell array of PPT API objects.
Attributes:
GetAccess | public |
SetAccess | private |
NonCopyable | true |
Data Types: cell
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 presentation 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 presentation element object.
You can specify your own value for Id.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Methods
append | Append table entry to table row |
|
Input Arguments
Return Values
For more information, see the method for the
|
Examples
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)