hello,
I want to know how can we merge the Aspose table cells for 3 rows.
I want to merge the Intrinsic Risk 4 columns
Intrinsic Risk |
4 |
very High |
Intrinsic Risk |
3 |
High |
Intrinsic Risk |
2 |
Moderate |
Intrinsic Risk |
1 |
Low |
Please help me in this context
Regards,
Ansuha VALLABHANENI.
Hi,
Thanks for providing some details.
Please see the document for your reference on merging / unmerging rows/ columns:
https://docs.aspose.com/cells/net/merging-and-unmerging-cells/
Thank you.
Hello,
I want to merge the table available in the aspose word document. I am attaching the document please have a look on it and help me in that.
Thank you in advance
Regards,
Anusha VALLABHANENI.
Hi Ansuha,
Thank you for writing back.
It seems that you are using Aspose.Words APIs to create documents rather than Aspose.Cells APIs to create spreadsheets. Could you please confirm that so we may move the thread to the appropriate forums?
Hello,
Yes I am using Aspose.words APIs to create document . sorry i posted in the wrong forum .
please forward to the appropriate Forum where i can get the solution.
Thanks & Regards,
Anusha VALLABHANENI.
Hi Ansuha,
Thank you for the confirmation. I am going to move the thread to the appropriate forum, that is; Aspose.Words support forum. My colleagues will soon evaluate your presented scenario and get back to you with updates in this regard.
Hi Anusha,
You can use the following code to merge all cells of first column and get your desired output. I have applied this logic to all tables in the document but you can apply it on any table according to your requirement.
Document doc = new Document("Intrinsic+Risk.docx");
foreach (Table table in doc.GetChildNodes(NodeType.Table, true))
{
foreach (Row row in table.Rows)
{
row.Cells[0].CellFormat.VerticalMerge = CellMerge.Previous;
}
table.Rows[0].Cells[0].CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
}
doc.Save("IntrinsicRisk_Result.docx");
Best Regards,
Hello,
Thank you for your reply. I am able to merge the cells now but unable to display the text for the mergerd cells.
In the Merged cell, i wan to display the text as “Intrinsic Risk” but not able to display.
How to solve that?
please find the attached doc
Thank you in advance,
Regards,
Anusha VALLABHANENi.
Hi Anusha,
Sorry, I was not able to reproduce this issue at my end. Above mentioned code displays the text at my end; please check attached output document. Can you please share the document to reproduce this issue?
Best Regards,