Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Sun Apr 20, 2014 6:29 pm

Hi,
I found everywhere in the help and document and forum, but I can't see any info about how to break a table cell into 2 cells in Spire.doc.

In my case, I need to create a custom word file, so I need to break some table cell into one-column and multi-rows cells inside.
How to do this?

Thank you very much!

yours,
ivan

ivanchain
 
Posts: 30
Joined: Wed Jan 22, 2014 12:42 am

Mon Apr 21, 2014 2:55 am

Dear ivan,

Thanks for your inquiry. Sorry for the inconvenience caused by the deficient samples.

Sorry that at present our Spire.Doc doesn't support to split one cell to multi-cells. We have added the feature into our schedule.
We will inform you when the feature is supported.

Please try
Code: Select all
ApplyHorizontalMerge(int rowIndex, int startCellIndex, int endCellIndex)
method and
Code: Select all
ApplyVerticalMerge(int columnIndex, int startRowIndex, int endRowIndex)
method to merge multi-cells into one cell.
Share sample code and attached the result:
Code: Select all
Document document = new Document();
            Section section = document.AddSection();
            Table table = section.AddTable(true);
            table.ResetCells(5, 5);
            table.ApplyHorizontalMerge(0, 0, 4);
            table.ApplyHorizontalMerge(1, 2,4);
            table.ApplyVerticalMerge(0, 2, 4);
            document.SaveToFile("Sample.docx",FileFormat.Docx);
            System.Diagnostics.Process.Start("Sample.docx");
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Fri Apr 25, 2014 2:29 am

Dear ivan,

The feature to split one cell to two or more cells has been supported. Welcome to download Spire.Doc for .NET Standard Edition Version:5.1 and test the method TableCell.SplitCell(int columnNum, int rowNum);.
Downloading link:http://www.e-iceblue.com/Download/download-word-for-net-now.html

Feel free to contact us if you have any problems.

Best wishes,
Amy
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Mon Apr 28, 2014 3:54 pm

Thank you so much!

I think the Merge Method is good for me.

yours,
Ivan

ivanchain
 
Posts: 30
Joined: Wed Jan 22, 2014 12:42 am

Tue Apr 29, 2014 1:36 am

Dear Ivan,

Thanks for your reply.

Feel free to contact us if you have any problems.

Best wishes,
Amy
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc