Class Banding
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
频段
访问和修改条带,即应用到某个范围的行或列的颜色模式。每个条带都由一个范围以及一系列行、列、页眉和页脚组成。
详细文档
copyTo(range)
将此条带复制到其他范围。
参数
名称 | 类型 | 说明 |
range | Range | 要将此条带复制到的范围。 |
返回
Banding
- 新条带。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstColumnColorObject()
返回条带中的第一个交替列颜色,如果未设置颜色,则返回 null
。
返回
Color
- 条带中的第一个交替列颜色,如果未设置颜色,则值为 null
。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstRowColorObject()
返回第一个交替行颜色;如果未设置颜色,则返回 null
。
返回
Color
- 频带中的第一个交替行颜色,如果未设置颜色,则值为 null
。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getHeaderColumnColorObject()
返回条带中第一列的颜色,如果未设置颜色,则返回 null
。
返回
Color
- 频带中的第一列颜色,如果未设置颜色,则为 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
。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondRowColorObject()
返回第二种交替行颜色;如果未设置颜色,则返回 null
。
返回
Color
- 频带中的第二个交替行颜色,如果未设置颜色,则为 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
- 采用 CSS 表示法(例如 '#ffffff'
或 'white'
)的颜色代码,如果未设置颜色,则返回 null
。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstRowColor()
已弃用。已替换为“getFirstRowColorObject()
”
返回交替的第一行颜色,如果未设置颜色,则返回 null
。
返回
String
- 采用 CSS 表示法(例如 '#ffffff'
或 'white'
)的颜色代码,如果未设置颜色,则返回 null
。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getHeaderColumnColor()
已弃用。已替换为“getHeaderColumnColorObject()
”
返回标题列的颜色;如果未设置颜色,则返回 null
。
返回
String
- 采用 CSS 表示法(例如 '#ffffff'
或 'white'
)的颜色代码,如果未设置颜色,则返回 null
。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
已弃用。已替换为“getHeaderRowColorObject()
”
返回标题行的颜色,如果未设置颜色,则返回 null
。
返回
String
- 采用 CSS 表示法(例如 '#ffffff'
或 'white'
)的颜色代码,如果未设置颜色,则返回 null
。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondColumnColor()
已弃用。已替换为“getSecondColumnColorObject()
”
返回交替显示的第二列颜色,如果未设置颜色,则返回 null
。
返回
String
- 十六进制颜色,如果未设置颜色,则为 null
。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondRowColor()
已弃用。已替换为“getSecondRowColorObject()
”
交替显示第二行颜色,如果未设置颜色,则返回 null
。
返回
String
- 采用 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):2022-08-18。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]