Home > database >  Apps Script making table in doc - Can't set column widths (Child index Error)
Apps Script making table in doc - Can't set column widths (Child index Error)

Time:01-12

I have build some quote to generate a sales quote, I have successfully added all the items into the quote using a Google Doc template. One issue I am getting is when trying to style the table, I keep getting this error when I have the setColumnWidth added in

enter image description here

The table is being populated from a mult-dymentional array, works if the setColumnWidth isn't there

enter image description here

var developerTableArray = quoteItem.developerItems;

var devloperTableSection = body.findText("{devloperTable}");
var devloperElement = devloperTableSection.getElement();

var childIndexDevloper = body.getChildIndex(devloperElement.getParent());

body.getChild(childIndexDevloper).asText().setText('');
body.insertTable(childIndexDevloper,developerTableArray).setColumnWidth(1, 60);

This is the code I am using to add the table in, am I just doing something wrong? Any help would be so appreciated!!

CodePudding user response:

enter image description here

References

  • Related