【问题标题】:Google Sheets style (Boldface only first line)Google 表格样式(仅第一行粗体字)
【发布时间】:2018-11-13 19:43:05
【问题描述】:

如何使用 Python 和 google-sheets api 仅将 Google Sheet 的第一行加粗。

我用过这个:

{  
   "requests":[  
      {  
         "repeatCell":{  
            "range":{  
               "sheetId":0,
               "startRowIndex":0,
               "endRowIndex":1
            },
            "cell":{  
               "userEnteredFormat":{  
                  "textFormat":{  
                     "bold":true
                  }
               }
            },
            "fields":"userEnteredFormat.textFormat.bold"
         }
      }
   ]
}

但这会将整个单元格加粗。

【问题讨论】:

    标签: python json google-sheets google-sheets-api


    【解决方案1】:

    像这样更改您的代码:

    {  
       "requests":[  
          {  
             "repeatCell":{  
                "range":{  
                   "endRowIndex":1
                },
                "cell":{  
                   "userEnteredFormat":{  
                      "textFormat":{  
                         "bold": true
                      }
                   }
                },
                "fields":"userEnteredFormat.textFormat.bold"
             }
          }
       ]
    }
    

    这将加粗工作表的第一行。 有关更多信息,请阅读 Google 表格中有关 range 的文档。

    【讨论】:

    • 谢谢你...但这将使第一行加粗..我想加粗单元格中的第一行..例如一个单元格中的两行,第一行加粗,第二行不加粗
    • 然后尝试将其添加到您的范围:startColumnIndex:0
    猜你喜欢
    • 2019-06-02
    • 1970-01-01
    • 1970-01-01
    • 2011-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多