问题
I'm trying to fill data to a spreadsheet using Google Spreadsheet API. What I do not understand is how can I copy styles from a row (e.g. the first one) to the cells created by my software.
I'm unable to find a way...
回答1:
Read/write styles use google-apps-script, this is the only way to read and write styles that I have seen.
source.copyTo(ss.getRange('Sheet2!A1'), {formatOnly: true});
copyTo docs: https://developers.google.com/apps-script/reference/spreadsheet/range#copyTo(Range,Object)
No styles in Google-spreadsheet-api: It does not have a way to read/write styles to the sheet. I have searched for this.
Read only You can read the styles, by getting the sheet as HTML. Not ideal, but works.
来源:https://stackoverflow.com/questions/18419939/how-to-copy-styles-of-a-cell-into-another-one-using-google-spreadsheet-api