I creating a google doc by script and want to insert table to it by this code:
var row1 = "some city"
var row2 = "some text"
var rowsData = [[row1, row2]];
var table = body.appendTable(rowsData);
table.setBorderWidth(0);
style[DocumentApp.Attribute.BOLD] = true;
style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] = DocumentApp.HorizontalAlignment.CENTER;
table.setAttributes(style);
I'm expecting that all text in cells will be bold and centered. But I see that only bold attribute applied. I've tried to add some script
var cell1 = table.getCell(0, 0);
var cell2 = table.getCell(0, 1);
cell1.setAttributes(style);
cell1.editAsText().setAttributes(style);
but no effect.
Please say me how to center text in cell properly!