【问题标题】:how to add table within another table cell using only office api from the document editor plugin如何仅使用文档编辑器插件中的 office api 在另一个表格单元格中添加表格
【发布时间】:2018-03-22 12:35:39
【问题描述】:

我们正在尝试仅使用文档编辑器插件中的 office api 在另一个表格单元格中添加表格。我们试图找出各种方法,例如使用 Range、Run Command、ParagraphAddDrawing、AddElement 等来做到这一点,但无法找到实现它的方法。

请尽早建议我们使用 API 实现此目的的正确方法...

问候

【问题讨论】:

    标签: onlyoffice


    【解决方案1】:

    您需要获取单元格并在其上使用方法Push()

    例子:

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-29
      • 2020-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-16
      • 1970-01-01
      相关资源
      最近更新 更多