Closed roengle closed 4 years ago
See below for the format of the request
See code below for centering all text. All text must be centered before resizing dimensions
{ "requests": [ { "repeatCell": { "range": { "sheetId": 0, "startColumnIndex": 0, "endColumnIndex": 20, "startRowIndex": 0 }, "cell": { "userEnteredFormat": { "horizontalAlignment": "CENTER", "verticalAlignment": "MIDDLE" } }, "fields": "userEnteredFormat(horizontalAlignment,verticalAlignment)" } } ] }
done (294b3db)
JSON for whole request
{
"requests": [
{
"autoResizeDimensions": {
"dimensions": {
"dimension": "COLUMNS",
"startIndex": 0,
"endIndex": 20,
"sheetId": 0
}
},
"repeatCell": {
"range": {
"sheetId": 0,
"startColumnIndex": 0,
"endColumnIndex": 20,
"startRowIndex": 0
},
"cell": {
"userEnteredFormat": {
"horizontalAlignment": "CENTER",
"verticalAlignment": "MIDDLE"
}
},
"fields": "userEnteredFormat(horizontalAlignment,veritcalAlignment)"
}
}
]
}
If possible from within the API, scale the columns of the sheet to be able to fit the data. Currently, things looks squished together, in which the columns must be manually scaled.