3

我想使用 javascript office api 在其他表格单元格中嵌套一个表格对象。

我看到 TableCell 对象没有方法 insertTable 所以我不能通过单元格调用它。表的方法 insertTable 只能接收“之前”和“之后”位置 - 因此新的位置将插入到父表之前或之后。

我已经通过使用以下代码设法通过 HTML 嵌套表格:

body.insertHtml('
<table border="1">
<tr>
<td>Cell1</td><td>Cell2</td>
</tr>
<tr>
<td>
    <table border=3 color=black>
    <tr><td>10</td><td>20</td><td>30</td></tr</table>
    </td>
<td>Cell 4</td>
</tr>
</table>', Word.InsertLocation.start);

有没有办法用 javacript API 嵌套一个表?

谢谢!

4

0 回答 0