0
我试图在空白文档上创建表格。我的问题是我不能在单元格中创建一个表格,即使文档说可以使用appendTable()。下面的代码在最后一行失败,出现错误“Service unavailable:Docs”。谢谢。Google Apps脚本表格 - 无法将内部表格添加到单元格
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();
}
感谢卡梅隆。您是否知道使用Google文档和Google Apps脚本构建自定义发票或报告的其他可能方式? –
我会建议尽可能使用Google表格。对于发票,通常我会创建一个模板电子表格,其中包含所有设置的布局,然后创建该模板的副本,更新发票号码,日期等的单元格。然后,我会将行插入表单中的任何订单项发票上。 –