Interface ICell
Represents the table cell.
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.NET.dll
Syntax
public interface ICell
Properties
CellBorders
Gets an ICellBorders instance that represents the borders and diagonal lines of a cell. Read-only.
Declaration
ICellBorders CellBorders { get; }
Property Value
Type |
---|
ICellBorders |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200);
//Get the cell from a row in a table
ICell cell = table.Rows[0].Cells[0];
//Get the cell border properties, read only
ICellBorders cellBorders = cell.CellBorders;
//Set the Cell border property
cellBorders.BorderBottom.BeginArrowheadLength = ArrowheadLength.Medium;
//Save the presentation
presentation.Save("CellBorders.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200)
'Get the cell from a row in a table
Dim cell As ICell = table.Rows(0).Cells(0)
'Get the cell border properties, read only
Dim cellBorders As ICellBorders = cell.CellBorders
'Set the Cell border property
cellBorders.BorderBottom.BeginArrowheadLength = ArrowheadLength.Medium
'Save the presentation
presentation__1.Save("CellBorders.pptx")
'Close the presentation
presentation__1.Close()
ColumnSpan
Gets or sets the number of cells merged in a row.
Declaration
int ColumnSpan { get; set; }
Property Value
Type |
---|
System.Int32 |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200);
//Get the cell from a row in a table
ICell cell = table.Rows[0].Cells[0];
//Set the column span
cell.ColumnSpan = 2;
//Save the presentation
presentation.Save("ColumnSpan.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200)
'Get the cell from a row in a table
Dim cell As ICell = table.Rows(0).Cells(0)
'Set the column span
cell.ColumnSpan = 2
'Save the presentation
presentation__1.Save("ColumnSpan.pptx")
'Close the presentation
presentation__1.Close()
ColumnWidth
Gets or sets the column width in points.
Declaration
double ColumnWidth { get; set; }
Property Value
Type |
---|
System.Double |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200);
//Get the cell from a row in a table
ICell cell = table.Rows[0].Cells[0];
//Set the column width
cell.ColumnWidth = 40;
//Save the presentation
presentation.Save("ColumnWidth.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200)
'Get the cell from a row in a table
Dim cell As ICell = table.Rows(0).Cells(0)
'Set the column width
cell.ColumnWidth = 40
'Save the presentation
presentation__1.Save("ColumnWidth.pptx")
'Close the presentation
presentation__1.Close()
Fill
Gets an IFill instance that contains fill formatting options. Read-only.
Declaration
IFill Fill { get; }
Property Value
Type |
---|
IFill |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200);
//Get the cell from a row in a table
ICell cell = table.Rows[0].Cells[0];
//Set the fill type of the cell as solid
cell.Fill.FillType = FillType.Solid;
//Set color for the solid fill
cell.Fill.SolidFill.Color = ColorObject.FromArgb(10, 34, 89, 32);
//Save the presentation
presentation.Save("CellFill.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200)
'Get the cell from a row in a table
Dim cell As ICell = table.Rows(0).Cells(0)
'Set the fill type of the cell as solid
cell.Fill.FillType = FillType.Solid
'Set color for the solid fill
cell.Fill.SolidFill.Color = ColorObject.FromArgb(10, 34, 89, 32)
'Save the presentation
presentation__1.Save("CellFill.pptx")
'Close the presentation
presentation__1.Close()
IsHorizontalMerge
Gets whether this cell is part of a horizontally merged cells. Read-only.
Declaration
bool IsHorizontalMerge { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200);
//Get the cell from a row in a table
ICell cell = table.Rows[0].Cells[0];
//Set the column span
cell.ColumnSpan = 2;
//Check if it is horizontal merge, it is read only
bool horizontalMerge = cell.IsHorizontalMerge;
//Save the presentation
presentation.Save("HorizontalMerge.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200)
'Get the cell from a row in a table
Dim cell As ICell = table.Rows(0).Cells(0)
'Set the column span
cell.ColumnSpan = 2
'Check if it is horizontal merge, it is read only
Dim horizontalMerge As Boolean = cell.IsHorizontalMerge
'Save the presentation
presentation__1.Save("HorizontalMerge.pptx")
'Close the presentation
presentation__1.Close()
IsVerticalMerge
Gets whether this cell is part of a vertically merged cells. Read-only.
Declaration
bool IsVerticalMerge { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200);
//Get the cell from a row in a table
ICell cell = table.Rows[0].Cells[0];
//Set the column span
cell.ColumnSpan = 2;
//Check if it is vertical merge, it is read only
bool verticalMerge = cell.IsVerticalMerge;
//Save the presentation
presentation.Save("VerticalMerge.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200)
'Get the cell from a row in a table
Dim cell As ICell = table.Rows(0).Cells(0)
'Set the column span
cell.ColumnSpan = 2
'Check if it is vertical merge, it is read only
Dim verticalMerge As Boolean = cell.IsVerticalMerge
'Save the presentation
presentation__1.Save("VerticalMerge.pptx")
'Close the presentation
presentation__1.Close()
RowSpan
Gets or sets the number of cells merged in a column.
Declaration
int RowSpan { get; set; }
Property Value
Type |
---|
System.Int32 |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200);
//Get the cell from a row in a table
ICell cell = table.Rows[0].Cells[0];
//Set the row span
cell.RowSpan = 2;
//Save the presentation
presentation.Save("RowSpan.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200)
'Get the cell from a row in a table
Dim cell As ICell = table.Rows(0).Cells(0)
'Set the row span
cell.RowSpan = 2
'Save the presentation
presentation__1.Save("RowSpan.pptx")
'Close the presentation
presentation__1.Close()
TextBody
Gets an ITextBody instance that represents the text in a paragraph. Read-only.
Declaration
ITextBody TextBody { get; }
Property Value
Type |
---|
ITextBody |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200);
//Get the cell from a row in a table
ICell cell = table.Rows[0].Cells[0];
//Set the text content for the cell
cell.TextBody.AddParagraph("First row First Cell");
//Save the presentation
presentation.Save("CellTextBody.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 3, 100, 120, 300, 200)
'Get the cell from a row in a table
Dim cell As ICell = table.Rows(0).Cells(0)
'Set the text content for the cell
cell.TextBody.AddParagraph("First row First Cell")
'Save the presentation
presentation__1.Save("CellTextBody.pptx")
'Close the presentation
presentation__1.Close()
Methods
Clone()
Creates a copy of the current cell.
Declaration
ICell Clone()
Returns
Type | Description |
---|---|
ICell | Returns the cloned cell object |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Gets the first column cell.
ICell cell = table.Columns[0].Cells[0];
//Clone the cell element.
ICell clonedCell = cell.Clone();
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim pptxDoc As IPresentation = Presentation.Create()
'Add the slide into the presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Gets the first column cell.
Dim cell As ICell = table.Columns(0).Cells(0)
'Clone the cell element.
Dim clonedCell As ICell = cell.Clone()
'Saves the Presentation.
pptxDoc.Save("Sample.pptx")
'Close the presentation.
pptxDoc.Close()