I’m trying to draw a table on Google Document using Google Apps Script then convert the result to PDF. That works fine but I couldn’t manipulate a height of cells.
Here is my code :
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);
I really need your help!
To change the height of every other row to 45 pixels, and the others to 22 pixels, I would have done something like this: