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.

Wed May 04, 2016 5:45 am

How to merge the table cell? for example ,I want to set the first cell multi-column.
Thanks.

iceblueDDX123
 
Posts: 34
Joined: Tue Apr 19, 2016 9:43 am

Wed May 04, 2016 6:04 am

Hello,

Please use the following method.
Code: Select all
Table table = (Table)doc.Sections[0].Tables[0];
table.Rows[0].Cells[0].SplitCell(5, 1);

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri May 06, 2016 1:28 am

Gary.zhang wrote:Hello,

Please use the following method.
Code: Select all
Table table = (Table)doc.Sections[0].Tables[0];
table.Rows[0].Cells[0].SplitCell(5, 1);

Sincerely,
Gary
E-iceblue support team

Thank you ,but it did not work,.By the way , the splitcell method is used to split a cell not to merge cells seemly.

iceblueDDX123
 
Posts: 34
Joined: Tue Apr 19, 2016 9:43 am

Fri May 06, 2016 4:48 am

Hello,

Apologies, we misunderstood what you mean.
Please try the below method:
Code: Select all
            Table table = (Table)doc.Sections[0].Tables[0];
            table.ApplyHorizontalMerge(0, 0, 4);


Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Fri May 06, 2016 7:34 am

caroline.zhang wrote:Hello,

Apologies, we misunderstood what you mean.
Please try the below method:
Code: Select all
            Table table = (Table)doc.Sections[0].Tables[0];
            table.ApplyHorizontalMerge(0, 0, 4);


Sincerely,
Caroline
E-iceblue support team

Thank you very much!

iceblueDDX123
 
Posts: 34
Joined: Tue Apr 19, 2016 9:43 am

Fri May 06, 2016 8:24 am

Glad to help you.
If there is any question, welcome to feel free to get it back to us.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Return to Spire.Doc