Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.ppt.TableStyleOptions class

Package: mlreportgen.ppt
Superclasses:

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.

Construction

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.

Output Arguments

expand all

Table style property options, returned as an mlreportgen.ppt.TableStyleOptions object.

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 PPT API object, specified as a character vector. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

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

An example of a reason for specifying your own tag value is to make it easier to identify where an issue occurred during presentation generation.

Examples

expand 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.* 
slidesFile = 'myppt.pptx'; 
slides = Presentation(slidesFile); 
add(slides,'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(slides,'Content',table); 
close(slides); 

if ispc 
winopen(slides.OutputPath); 
end

Introduced in R2016a

Was this topic helpful?