我创建了一个非常简单的 Google-Script 来将表格添加到 Google Docs 中:
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)中获取字体或颜色?