Skip to main content

SetSize

Sets the table size.

Syntax

expression.SetSize(width, height);

expression - A variable that represents a ApiTable class.

Parameters

NameRequired/OptionalData typeDefaultDescription
widthRequiredEMUThe table width measured in English measure units.
heightRequiredEMUThe table height measured in English measure units.

Returns

This method doesn't return any data.

Example

Set the size of a table in a presentation.

// How do I set size in a presentation?

// Set size using a table object in a presentation.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();

const table = Api.CreateTable(2, 4);
table.SetSize(220 * 36000, 110 * 36000);

const row = table.GetRow(0);
const cell = row.GetCell(0);
const content = cell.GetContent();
const paragraph = Api.CreateParagraph();
paragraph.AddText('Table size: 220 x 110 millimeters.');
content.Push(paragraph);

slide.AddObject(table);