Если у вас есть документ (DocumentApp.openById или DocumentApp.create или DocumentApp.openByUrl), вам нужно получить тело, выполнить поиск таблиц, а затем обработать их TableCells.
Somethingкак:
var doc = DocumentApp.openByUrl([URL]);
var body = doc.getBody();
var tables = body.getTables();
for each (var table in tables) {
var i;
for (i = 0; i < table.getNumRows(); i++) {
var row = table.getRow(i);
var j;
for (j = 0; j < row.getNumCells(); j++) {
var cell = row.getCell(j);
// formatting goes here
// example based on a numeric cell and a threshold of 50
if (cell.getValue() > 50) {
cell.setBackgroundColor("#ff0000");
} else {
cell.setBackgroundColor("#00ff00");
}
// Define a custom paragraph style.
// can be used for more complicated formatting
var style = {};
style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =
DocumentApp.HorizontalAlignment.RIGHT;
style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
style[DocumentApp.Attribute.FONT_SIZE] = 18;
style[DocumentApp.Attribute.BOLD] = true;
cell.setAttributes(style);
}
}
}