【发布时间】:2017-08-23 01:35:28
【问题描述】:
我创建了一个非常简单的 Google 脚本来将表格添加到 Google 文档中:
var body = DocumentApp.getActiveDocument().getFooter();
body.clear();
var cells = [
['Cell1', 'Cell2', 'Cell3', 'Cell4'],
['Cell5', 'Cell6', 'Cell7', 'Cell8'],
];
var myT = body.appendTable(cells);
var style ={};
style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] = DocumentApp.HorizontalAlignment.RIGHT;
style[DocumentApp.Attribute.FONT_FAMILY] = 'Verdana';
myT.setAttributes(style);
myT.setColumnWidth(0, 178.661);
myT.setColumnWidth(1, 106.9681);
myT.setColumnWidth(2, 74.6011);
脚本运行良好。现在我得到了这个问题:
如何更改表格中的“单元格填充”? 如何从定义的字段(例如 col 2 row 2)中获取字体或颜色?
【问题讨论】:
标签: google-apps-script string-formatting google-docs-api cellpadding