2

We are trying to add table within another table cell using only office api from the document editor plugin. We tried to find out various methods like using Range, Run Command, ParagraphAddDrawing, AddElement etc. to do it , but are unable to find a way to achieve it.

Please advice us an proper way to achieve this using API as early as possible...

Regards

Vikas Nale
  • 303
  • 2
  • 12

1 Answers1

1

You need to get cell and use method Push() on it.

Example:

var oDocument = Api.GetDocument(); // getting document object
var oParagraph, oTable, oCell; // init variables
oTable = Api.CreateTable(3, 3); // creating new table object
oCell = oTable.GetRow(0).GetCell(0); //getting first cell in first row
oDocument.Push(oTable); // Push new table to document
oTable_two = Api.CreateTable(3, 3); // creating second table object
oParagraph = oCell.GetContent().Push(oTable_two); // pushing new table to first table
Flamine
  • 487
  • 4
  • 21