我正在尝试在 Google Document 上绘制一个表格,Google Apps Script
然后将结果转换为PDF
. 这工作正常,但我无法操纵细胞的高度。这是我的代码:
var TemplateCopyBody = DocumentApp.openById("id").getActiveSection();
var tableStyle = {};
tableStyle[DocumentApp.Attribute.FONT_SIZE] = 8;
tableStyle[DocumentApp.Attribute.FONT_FAMILY] = DocumentApp.FontFamily.UBUNTU;
tableStyle[DocumentApp.Attribute.BOLD] = 0;
tableStyle[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] = 0;
tableStyle[DocumentApp.Attribute.PADDING_RIGHT] = 0;
tableStyle[DocumentApp.Attribute.HEIGHT] = 0;
/* Function to populate my table */
var myTable = new Array();
for(var i=0;i<RESULT.marksDetails.length -1;i++){
myTable[i] = RESULT.notesDetails[i];
Logger.log("insertion table : "+i);
}
TemplateCopyBody.appendTable(myTable).setAttributes(tableStyle).setColumnWidth(0, 300);
我真的需要你的帮助!