Skip to main content

SetTablePr

Sets the table properties to the current table style properties.

Syntax​

expression.SetTablePr(oTablePr);

expression - A variable that represents an ApiTableStylePr class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
oTablePrRequiredApiTablePrThe table properties to apply.

Returns​

boolean

Example​

Modify the wholeTable conditional style of a named table style and apply it to a table.

// The table properties stored in a conditional style part are updated.

// Get the wholeTable part of a presentation style, set its borders, and apply the style to a table.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
const table = Api.CreateTable(3, 3);
const style = presentation.GetStyle("Medium Style 2 - Accent 2");
table.SetStyle(style);
const stylepr = style.GetConditionalTableStyle("wholeTable");
const tablePr = stylepr.GetTablePr();
tablePr.SetTableBorderAll("single", 0.5, Api.CreateSolidFill(Api.RGB(255, 0, 0)));
stylepr.SetTablePr(tablePr);
slide.RemoveAllObjects();
slide.AddObject(table);