Main Content

mlreportgen.ppt.TableStyleOptions Class

Namespace: mlreportgen.ppt

Stripe table rows and columns

Description

Specifies whether to format table rows and columns. Before you use TableStyleOptions, specify the table style using the StyleName property on the Table object you want to apply the options to. The table style determines the formatting of the table, for example, the color of the banding and first- and last-column emphasis.

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

Creation

Description

tableStyles = TableStyleOptions creates a TableStyleOptions object. This object uses the properties of the table style assigned to the StyleName property of the table you assign the properties to. The table uses the TableStyleOption object only if the associated table sets the StyleName property.

example

Properties

expand all

Alternating color (banding) for columns, specified as:

  • true — Colors alternate for columns.

  • false — Columns use same color.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Alternating color for rows, specified as:

  • true — Colors alternate for rows.

  • false — Rows use same color.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Emphasis for first column in table, specified as:

  • true — First column uses emphasis styling, e.g., stronger color, emphasized font.

  • false — Regular styling on first column.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Emphasis for first row of table, specified as:

  • true — First row uses emphasis styling, e.g., stronger color, emphasized font.

  • false — Regular styling on first row.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Emphasis for last column in table, specified as:

  • true — Last column uses emphasis styling, e.g., stronger color, emphasized font.

  • false — Regular styling on last column.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Emphasis for last row of table, specified as:

  • true — Last row uses emphasis styling, e.g., stronger color, emphasized font.

  • false — Regular styling on last row.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

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

This example shows how to control the formatting of a table based on the Medium Style 2 - Accent 1 table style in the default PPT template. Change the values of each of the styling properties from false to true, or the reverse, to understand their effects.

import mlreportgen.ppt.* 

ppt = Presentation("myppt.pptx"); 
open(ppt);
add(ppt,"Title and Content"); 

% Create the tableand specify the table style name
table = Table(magic(5)); 
table.StyleName = "Medium Style 2 - Accent 1"; 

% Create the format and set the properties
tblStyle = TableStyleOptions(); 
tblStyle.FirstRow = false; 
tblStyle.LastRow = false; 
tblStyle.FirstColumn = true; 
tblStyle.LastColumn = false; 
tblStyle.BandedRows = true; 
tblStyle.BandedColumns = false; 

% Apply the formatting to the table
table.Style = {tblStyle}; 

% Add the table to the slide
% Generate and display the presentation
replace(ppt,"Content",table); 
close(ppt); 
rptview(ppt);

Version History

Introduced in R2016a