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

example

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.

Properties

expand all

Alternating color (banding) for columns, specified as:

  • true — Colors alternate for columns.

  • false — Columns use same color.

Alternating color for rows, specified as:

  • true — Colors alternate for rows.

  • false — Rows use same color.

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.

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.

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

Attributes:

NonCopyable
true

Data Types: char | string

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.

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.

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 issues occur during presentation generation.

Attributes:

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