Class Banding
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
分级
访问和修改条带化,即应用于某个范围的行或列的颜色模式。每个条带都包含一个范围以及一组用于行、列、标题和页脚的颜色。
详细文档
copyTo(range)
将此分段复制到另一个范围。
参数
| 名称 | 类型 | 说明 |
range | Range | 要将此条带复制到的范围。 |
返回
Banding - 新的频段。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstColumnColorObject()
返回条带中的第一个交替列颜色;如果未设置颜色,则返回 null。
返回
Color|null - 条带中的第一个交替列颜色;如果未设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstRowColorObject()
返回第一个交替行颜色,如果没有设置颜色,则返回 null。
返回
Color|null - 条带中的第一个交替行颜色;如果未设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getHeaderColumnColorObject()
返回条带中第一列的颜色,如果没有设置颜色,则返回 null。
返回
Color|null - 条带中的第一列颜色;如果未设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRange()
返回相应分段的范围。
返回
Range - 相应频段的范围。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondColumnColorObject()
返回带状样式中的第二个交替列颜色;如果未设置颜色,则返回 null。
返回
Color|null - 条带中的第二种交替列颜色,如果没有设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondRowColorObject()
返回第二个交替行颜色;如果未设置颜色,则返回 null。
返回
Color|null - 条带中的第二种交替行颜色,如果没有设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
remove()
移除此条带。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstColumnColor(color)
设置交替显示的第一列颜色。
参数
| 名称 | 类型 | 说明 |
color | String | 采用 CSS 表示法的颜色代码(例如 '#ffffff' 或 'white'),或 null 以清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstColumnColorObject(color)
设置条带中的第一个交替列颜色。
参数
| 名称 | 类型 | 说明 |
color | Color | 条带中的新第一个交替列颜色;设置为 null 可清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstRowColor(color)
设置交替显示的第一行颜色。
参数
| 名称 | 类型 | 说明 |
color | String | 采用 CSS 表示法的颜色代码(例如 '#ffffff' 或 'white'),或 null 以清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstRowColorObject(color)
设置条带中的第一个交替行颜色。
参数
| 名称 | 类型 | 说明 |
color | Color | 条带中的新第一个交替颜色;设置为 null 可清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setHeaderColumnColor(color)
设置标题列的颜色。
参数
| 名称 | 类型 | 说明 |
color | String | 采用 CSS 表示法的颜色代码(例如 '#ffffff' 或 'white'),或 null 以清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setHeaderColumnColorObject(color)
设置标题列的颜色。
参数
| 名称 | 类型 | 说明 |
color | Color | 新的标题列颜色;设置为 null 可清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setRange(range)
为此条带设置范围。
参数
| 名称 | 类型 | 说明 |
range | Range | 相应频段的新范围。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondColumnColor(color)
设置交替的第二列颜色。
参数
| 名称 | 类型 | 说明 |
color | String | 采用 CSS 表示法的颜色代码(例如 '#ffffff' 或 'white'),或 null 以清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondColumnColorObject(color)
设置条带中的第二个交替列颜色。
参数
| 名称 | 类型 | 说明 |
color | Color | 带状图中的新第二种交替列颜色;设置为 null 可清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondRowColor(color)
设置交替的第二行颜色。
参数
| 名称 | 类型 | 说明 |
color | String | 采用 CSS 表示法的颜色代码(例如 '#ffffff' 或 'white'),或 null 以清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondRowColorObject(color)
设置条带中的第二种交替颜色。
参数
| 名称 | 类型 | 说明 |
color | Color | 条带中的新第二种交替颜色;设置为 null 可清除颜色。 |
返回
Banding - 此频段,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
已弃用的方法
getFirstColumnColor()
已弃用。已替换为 getFirstColumnColorObject()
返回第一个交替列颜色,如果没有设置颜色,则返回 null。
返回
String|null - CSS 表示法中的颜色代码(例如 '#ffffff' 或 'white'),如果没有设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstRowColor()
已弃用。已替换为 getFirstRowColorObject()
返回第一个交替行颜色,如果没有设置颜色,则返回 null。
返回
String|null - CSS 表示法中的颜色代码(例如 '#ffffff' 或 'white'),如果没有设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getHeaderColumnColor()
已弃用。已替换为 getHeaderColumnColorObject()
返回标题列的颜色;如果未设置颜色,则返回 null。
返回
String|null - CSS 表示法中的颜色代码(例如 '#ffffff' 或 'white'),如果没有设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
已弃用。已替换为 getHeaderRowColorObject()
返回标题行的颜色;如果未设置颜色,则返回 null。
返回
String|null - CSS 表示法中的颜色代码(例如 '#ffffff' 或 'white'),如果没有设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondColumnColor()
已弃用。已替换为 getSecondColumnColorObject()
返回交替的第二列颜色;如果未设置颜色,则返回 null。
返回
String|null - 十六进制颜色或 null(如果未设置颜色)。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondRowColor()
已弃用。已替换为 getSecondRowColorObject()
返回交替的第二行颜色;如果未设置颜色,则返回 null。
返回
String|null - CSS 表示法中的颜色代码(例如 '#ffffff' 或 'white'),如果没有设置颜色,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-12-11。
[null,null,["最后更新时间 (UTC):2025-12-11。"],[],[]]