Main Content

mlreportgen.ppt.Border Class

Namespace: mlreportgen.ppt

Border of a table or table entry

Since R2020a

Description

Use an mlreportgen.ppt.Border format object to customize the border of a table or table entry in a PPT API presentation.

Note

A conflict occurs if a border segment is shared by two table entries. For a conflicting horizontal border segment, Microsoft® PowerPoint® ignores the formats specified by the entry on the bottom. For a conflicting vertical border segment, PowerPoint ignores the formats specified by the entry on the right.

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

Class Attributes

ConstructOnLoad
true
HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

mlreportgen.ppt.Border creates an empty mlreportgen.ppt.Border object. By default, PowerPoint renders table borders as thin, solid, black lines. Use the object properties to specify a different border width, style, or color.

example

mlreportgen.ppt.Border(style) sets the Style, TopStyle, BottomStyle, LeftStyle, and RightStyle properties to the value of style.

mlreportgen.ppt.Border(style,color) also sets the Color, TopColor, BottomColor, LeftColor, and RightColor properties to the value of color.

mlreportgen.ppt.Border(style,color,width) also sets the Width, TopWidth, BottomWidth, LeftWidth, and RightWidth properties to the value of width.

Properties

expand all

Default style of border segments, specified as a character vector or string scalar. Specify one of these values:

  • "none"

  • "solid"

  • "dot"

  • "dash"

  • "largeDash"

  • "dashDot"

  • "largeDashDot"

  • "largeDashDotDot"

  • "systemDash"

  • "systemDot"

  • "systemDashDot"

  • "systemDashDotDot"

Data Types: char | string

Default color of border segments, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.

Data Types: char | string

Default width of border segments, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, "3pt" specifies three points. Valid abbreviations are:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Data Types: char | string

Style of the top border segment, specified as a character vector or string scalar. Specify one of these values:

  • "none"

  • "solid"

  • "dot"

  • "dash"

  • "largeDash"

  • "dashDot"

  • "largeDashDot"

  • "largeDashDotDot"

  • "systemDash"

  • "systemDot"

  • "systemDashDot"

  • "systemDashDotDot"

Data Types: char | string

Color of the top border segment, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.

Data Types: char | string

Width of the top border segment, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, "3pt" specifies three points. Valid abbreviations are:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Data Types: char | string

Style of the bottom border segment, specified as a character vector or string scalar. Specify one of these values:

  • "none"

  • "solid"

  • "dot"

  • "dash"

  • "largeDash"

  • "dashDot"

  • "largeDashDot"

  • "largeDashDotDot"

  • "systemDash"

  • "systemDot"

  • "systemDashDot"

  • "systemDashDotDot"

Data Types: char | string

Color of the bottom border segment, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.

Data Types: char | string

Width of the bottom border segment, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, "3pt" specifies three points. Valid abbreviations are:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Data Types: char | string

Style of the left border segment, specified as a character vector or string scalar. Specify one of these values:

  • "none"

  • "solid"

  • "dot"

  • "dash"

  • "largeDash"

  • "dashDot"

  • "largeDashDot"

  • "largeDashDotDot"

  • "systemDash"

  • "systemDot"

  • "systemDashDot"

  • "systemDashDotDot"

Data Types: char | string

Color of the left border segment, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.

Data Types: char | string

Width of the left border segment, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, "3pt" specifies three points. Valid abbreviations are:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Data Types: char | string

Style of the right border segment, specified as a character vector or string scalar. Specify one of these values:

  • "none"

  • "solid"

  • "dot"

  • "dash"

  • "largeDash"

  • "dashDot"

  • "largeDashDot"

  • "largeDashDotDot"

  • "systemDash"

  • "systemDot"

  • "systemDashDot"

  • "systemDashDotDot"

Data Types: char | string

Color of the right border segment, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.

Data Types: char | string

Width of the right border segment, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, "3pt" specifies three points. Valid abbreviations are:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Data Types: char | string

Object identifier for the mlreportgen.ppt.Border object, 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:

NonCopyable
true

Data Types: char | string

Tag for the mlreportgen.ppt.Border object, 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. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

Examples

collapse all

To customize the border or a border segment of a table or table entry in a PPT API presentation, specify the border style, color, and width in an mlreportgen.ppt.Border format object and add the object to the Style property of an mlreportgen.ppt.Table or mlreportgen.ppt.TabeEntry object. This example specifies that the bottom border of the entry in the second row and second column is dashed, red, and has a width of three points.

Create a presentation.

import mlreportgen.ppt.*
ppt = Presentation("myTEBorders.pptx");
open(ppt);

Add a slide to the presentation.

slide = add(ppt,"Title and Table");

Create a table.

t = Table(magic(3));

Create a border object to customize the bottom border segment.

border = Border();
border.BottomStyle = "dash";
border.BottomColor = "red";
border.BottomWidth = "3pt";

Apply the custom border to the entry in the second column and second row.

tr2te2 = t.entry(2,2);
tr2te2.Style = [tr2te2.Style {border}];

Add a title and the table to the slide.

replace(slide,"Title","Table entry with custom borders");
replace(slide,"Table",t);

Close and view the presentation.

close(ppt);
rptview(ppt);

Here is the table in the generated presentation:

Version History

Introduced in R2020a