This article is going to demonstrate how to split a specific table cell in PowerPoint using Spire.Presentation.
The original table:
Detail steps:
Step 1: Instantiate a Presentation object and load the PowerPoint file.
Presentation ppt = new Presentation(); ppt.LoadFromFile("Input.pptx");
Step 2: Get the first slide.
ISlide slide = ppt.Slides[0];
Step 3: Get the table on the slide.
ITable table = slide.Shapes[0] as ITable;
Step 4: Split the cell [1, 2] into 3 rows and 2 columns.
table[1, 2].Split(3, 2);
Step 5: Save the file.
ppt.SaveToFile("Split.pptx", FileFormat.Pptx2013);
Screenshot after splitting:
Full code:
using Spire.Presentation; namespace Split_Table_Cells_in_PPT { class Program { static void Main(string[] args) { //Instantiate a Presentation object Presentation ppt = new Presentation(); //Load the PowerPoint file ppt.LoadFromFile("Input.pptx"); //Get the first slide ISlide slide = ppt.Slides[0]; //Get the table ITable table = slide.Shapes[0] as ITable; //Split cell [1, 2] into 3 rows and 2 columns table[1, 2].Split(3, 2); //Save the file ppt.SaveToFile("Split.pptx", FileFormat.Pptx2013); } } }