I have create a very simply Google-Script to add a table into a Google Docs:
var body = DocumentApp.getActiveDocument().getFooter();
body.clear();
var cells = [
['Cell1', 'Cell2', 'Cell3', 'Cell4'],
['Cell5', 'Cell6', 'Cell7', 'Cell8'],
];
var myT = body.appendTable(cells);
var style ={};
style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] = DocumentApp.HorizontalAlignment.RIGHT;
style[DocumentApp.Attribute.FONT_FAMILY] = 'Verdana';
myT.setAttributes(style);
myT.setColumnWidth(0, 178.661);
myT.setColumnWidth(1, 106.9681);
myT.setColumnWidth(2, 74.6011);
The script works fine. Now I get this question:
How can I change the "Cell Padding" from the Table? How can I the font or the color from a defined field (e.g. col 2 row 2)?
It seems there's no methods for cell padding as mentioned in this google forum, however you can try their suggested workarounds. For changing cell color, there's setBackGroundColor and to to change font color, there's setFontColor.