繁体   English   中英

Google Apps脚本表-无法将内部表添加到单元格

[英]Google Apps Scripts Table - cannot add inner table to a cell

我正在尝试在空白文档上创建表。 我的问题是,即使文档说可以使用appendTable(),也无法在单元格中创建表。 下面的代码在最后一行失败,错误为“服务不可用:文档”。 谢谢。

function buildInvoice() {

//create new document
var doc = DocumentApp.create('MyWorld');

doc.appendParagraph("That's it!");

var body = doc.getBody();

var table = body.appendTable();
var table3 = body.appendTable();
var tr_header = table.appendTableRow();
var td_header = tr_header.appendTableCell("Heading");
td_header.setBackgroundColor("#CFCFCF");
var row1 = table.appendTableRow();
var cell1 = row1.appendTableCell("cell 1");
var cell2 = row1.appendTableCell();
cell2.appendTable();
}

看起来是个错误,这里有一个未解决的问题,其变通办法是:

https://code.google.com/p/google-apps-script-issues/issues/detail?id=894#c2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM