ApiTableRow

new ApiTableRow()

Class representing a table row.

Methods

Name Description
GetCell

Returns a cell by its position in the current row.

GetCellsCount

Returns a number of cells in the current row.

GetClassType

Returns the type of the ApiTableRow class.

SetHeight

Sets the height to the current table row.

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oTable = Api.CreateTable(2, 4);
var oRow = oTable.GetRow(0);
oRow.SetHeight(30 * 36000);
var oCellsCount = oRow.GetCellsCount();
var oCell = oRow.GetCell(0);
var oContent = oCell.GetContent();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("The number of cells in the row: " + oCellsCount);
oContent.Push(oParagraph);
oParagraph = Api.CreateParagraph();
var sClassType = oRow.GetClassType();
oParagraph.AddText("Class type: " + sClassType);
oContent.Push(oParagraph);
var oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
oSlide.AddObject(oTable);
builder.SaveFile("pptx", "ApiTableRow.pptx");
builder.CloseFile();

Resulting document