Interface IColumn
Represents the Column in a table.
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface IColumn
Properties
Cells
Gets an ICells instance that represents the cell collection. Read-only
Declaration
ICells Cells { get; }
Property Value
Type | Description |
---|---|
ICells | The cells. |
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);
//Get the column from column collection
IColumn column = table.Columns[0];
//Get the cell collection from the column, read only
ICells cells = column.Cells;
//Set the text content for cells in column
cells[0].TextBody.AddParagraph("First row, First Column");
cells[1].TextBody.AddParagraph("Second row, First Column");
//Save the presentation
presentation.Save("Sample.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(2, 2, 100, 120, 300, 200)
'Get the column from column collection
Dim column As IColumn = table.Columns(0)
'Get the cell collection from the column, read only
Dim cells As ICells = column.Cells
'Set the text content for cells in column
cells(0).TextBody.AddParagraph("First row, First Column")
cells(1).TextBody.AddParagraph("Second row, First Column")
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Width
Gets or sets width of the column, in points.
Declaration
double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The width. |
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);
//Get the column from column collection
IColumn column = table.Columns[0];
//Set the width of the column
column.Width = 240;
//Save the presentation
presentation.Save("Sample.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(2, 2, 100, 120, 300, 200)
'Get the column from column collection
Dim column As IColumn = table.Columns(0)
'Set the width of the column
column.Width = 240
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Methods
Clone()
Creates a copy of the current column.
Declaration
IColumn Clone()
Returns
Type | Description |
---|---|
IColumn | Returns the cloned column 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);
//Clone the column element.
IColumn column = table.Columns[0].Clone();
//Add text content to the cell.
column.Cells[0].TextBody.Text = "Cloned column";
//Add column to the collection
table.Columns.Add(column);
//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)
'Clone the column element.
Dim column As IColumn = table.Columns(0).Clone()
'Add text content to the cell.
column.Cells(0).TextBody.Text = "Cloned column"
'Add column to the collection
table.Columns.Add(column)
'Saves the Presentation.
pptxDoc.Save("Sample.pptx")
'Close the presentation.
pptxDoc.Close()