ApiTableCell
Class representing a table cell.
Methods
Name |
Description |
GetClassType |
Returns the type of the ApiTableCell class. |
GetContent |
Returns the current cell content. |
SetCellBorderBottom |
Sets the border which shall be displayed at the bottom of the current table cell. |
SetCellBorderLeft |
Sets the border which shall be displayed at the left of the current table cell. |
SetCellBorderRight |
Sets the border which shall be displayed at the right of the current table cell. |
SetCellBorderTop |
Sets the border which shall be displayed at the top of the current table cell. |
SetCellMarginBottom |
Specifies an amount of space which shall be left between the bottom extent of the cell contents and the border
of a specific individual table cell within a table. |
SetCellMarginLeft |
Specifies an amount of space which shall be left between the left extent of the current cell contents and the
left edge border of a specific individual table cell within a table. |
SetCellMarginRight |
Specifies an amount of space which shall be left between the right extent of the current cell contents and the
right edge border of a specific individual table cell within a table. |
SetCellMarginTop |
Specifies an amount of space which shall be left between the top extent of the current cell contents and the
top edge border of a specific individual table cell within a table. |
SetShd |
Specifies the shading which shall be applied to the extents of the current table cell. |
SetTextDirection |
Specifies the direction of the text flow for the current table cell. |
SetVerticalAlign |
Specifies the vertical alignment for text within the current table cell. |
Example
Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oTable = Api.CreateTable(2, 4);
var oRow = oTable.GetRow(0);
var oCell = oRow.GetCell(0);
var oContent = oCell.GetContent();
var oParagraph = Api.CreateParagraph();
var sClassType = oCell.GetClassType();
oParagraph.AddText("Class type: " + sClassType);
oContent.Push(oParagraph);
var oFill = Api.CreateSolidFill(Api.CreateRGBColor(51, 51, 51));
oCell.SetCellBorderBottom(1, oFill);
oCell.SetCellBorderTop(1, oFill);
oCell.SetCellBorderLeft(1, oFill);
oCell.SetCellBorderRight(1, oFill);
oCell.SetCellMarginTop(500);
oCell.SetCellMarginLeft(1000);
var oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
oSlide.AddObject(oTable);
builder.SaveFile("pptx", "ApiTableCell.pptx");
builder.CloseFile();
Resulting document