In this topic, we will learn how to add Rows to Table in DOCX using C++. Tables have wide utility inside Word document and you can easily insert rows inside table of Word document by using a very simple C++ API interface.
Steps to Insert Rows inside Table in DOCX using C++
- Install Aspose.Words.Cpp using NuGet package Manager
- Add reference to Aspose::Words and Aspose::Words::Tables namespaces
- Instantiate Document Class object to load document for managing Table Rows
- Access the Table in first section by using Table Class object
- Add rows in Table using multiple options
- Save the Word document with table row to DOCX format using Save method
In the following example we have shown, how you can insert rows from scratch inside table of a Word document. It also describes, how you can clone existing rows inside table and add new ones using cloned rows inside DOCX table.
Code to Insert Rows inside Table in DOCX using C++
In previous example, we looked in to How to Insert Header and Footer in DOCX using C++. Whereas in this topic, we have learnt about adding rows to table of a Word document using C++.