跳到主要内容

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

This example shows how to set the size of a table.

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);