如何使用Python和Google sheets api仅粗体显示Google Sheet的第一行。
我用过这个:
{
"requests":[
{
"repeatCell":{
"range":{
"sheetId":0,
"startRowIndex":0,
"endRowIndex":1
},
"cell":{
"userEnteredFormat":{
"textFormat":{
"bold":true
}
}
},
"fields":"userEnteredFormat.textFormat.bold"
}
}
]
}
但这个粗体字代表了整个单元格。
这样更改代码:
{
"requests":[
{
"repeatCell":{
"range":{
"endRowIndex":1
},
"cell":{
"userEnteredFormat":{
"textFormat":{
"bold": true
}
}
},
"fields":"userEnteredFormat.textFormat.bold"
}
}
]
}
这将加粗工作表的第一行。有关更多信息,请阅读Google Sheets中有关范围的文档。