How to Add Rows to Table in DOCX using C++

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++

  1. Install Aspose.Words.Cpp using NuGet package Manager
  2. Add reference to Aspose::Words and Aspose::Words::Tables namespaces
  3. Instantiate Document Class object to load document for managing Table Rows
  4. Access the Table in first section by using Table Class object
  5. Add rows in Table using multiple options
  6. 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++.

 English