Class Banding

分级

访问和修改条带化,即应用于某个范围的行或列的颜色模式。每个条带都包含一个范围以及一组用于行、列、标题和页脚的颜色。

方法

方法返回类型简介
copyTo(range)Banding将此分段复制到另一个范围。
getFirstColumnColorObject()Color|null返回条带中的第一个交替列颜色;如果未设置颜色,则返回 null
getFirstRowColorObject()Color|null返回第一个交替行颜色,如果没有设置颜色,则返回 null
getFooterColumnColorObject()Color|null返回条带中最后一列的颜色,如果没有设置颜色,则返回 null
getFooterRowColorObject()Color|null返回条带中的最后一行颜色,如果没有设置颜色,则返回 null
getHeaderColumnColorObject()Color|null返回条带中第一列的颜色,如果没有设置颜色,则返回 null
getHeaderRowColorObject()Color|null返回标题行的颜色;如果未设置颜色,则返回 null
getRange()Range返回相应分段的范围。
getSecondColumnColorObject()Color|null返回带状样式中的第二个交替列颜色;如果未设置颜色,则返回 null
getSecondRowColorObject()Color|null返回第二个交替行颜色;如果未设置颜色,则返回 null
remove()void移除此条带。
setFirstColumnColor(color)Banding设置交替显示的第一列颜色。
setFirstColumnColorObject(color)Banding设置条带中的第一个交替列颜色。
setFirstRowColor(color)Banding设置交替显示的第一行颜色。
setFirstRowColorObject(color)Banding设置条带中的第一个交替行颜色。
setFooterColumnColor(color)Banding设置最后一列的颜色。
setFooterColumnColorObject(color)Banding设置条带化中最后一列的颜色。
setFooterRowColor(color)Banding设置最后一行的颜色。
setFooterRowColorObject(color)Banding设置条带化中页脚行的颜色。
setHeaderColumnColor(color)Banding设置标题列的颜色。
setHeaderColumnColorObject(color)Banding设置标题列的颜色。
setHeaderRowColor(color)Banding设置标题行的颜色。
setHeaderRowColorObject(color)Banding设置标题行的颜色。
setRange(range)Banding为此条带设置范围。
setSecondColumnColor(color)Banding设置交替的第二列颜色。
setSecondColumnColorObject(color)Banding设置条带中的第二个交替列颜色。
setSecondRowColor(color)Banding设置交替的第二行颜色。
setSecondRowColorObject(color)Banding设置条带中的第二种交替颜色。

详细文档

copyTo(range)

将此分段复制到另一个范围。

参数

名称类型说明
rangeRange要将此条带复制到的范围。

返回

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

getFooterColumnColorObject()

返回条带中最后一列的颜色,如果没有设置颜色,则返回 null

返回

Color|null - 条带中的最后一列颜色,如果没有设置颜色,则为 null

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getFooterRowColorObject()

返回条带中的最后一行颜色,如果没有设置颜色,则返回 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

getHeaderRowColorObject()

返回标题行的颜色;如果未设置颜色,则返回 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)

设置交替显示的第一列颜色。

参数

名称类型说明
colorString采用 CSS 表示法的颜色代码(例如 '#ffffff''white'),或 null 以清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFirstColumnColorObject(color)

设置条带中的第一个交替列颜色。

参数

名称类型说明
colorColor条带中的新第一个交替列颜色;设置为 null 可清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFirstRowColor(color)

设置交替显示的第一行颜色。

参数

名称类型说明
colorString采用 CSS 表示法的颜色代码(例如 '#ffffff''white'),或 null 以清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFirstRowColorObject(color)

设置条带中的第一个交替行颜色。

参数

名称类型说明
colorColor条带中的新第一个交替颜色;设置为 null 可清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFooterColumnColor(color)

设置最后一列的颜色。

参数

名称类型说明
colorString采用 CSS 表示法的颜色代码(例如 '#ffffff''white'),或 null 以清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFooterColumnColorObject(color)

设置条带化中最后一列的颜色。

参数

名称类型说明
colorColor条带中最后一列的新颜色;设置为 null 可清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFooterRowColor(color)

设置最后一行的颜色。

参数

名称类型说明
colorString采用 CSS 表示法的颜色代码(例如 '#ffffff''white'),或 null 以清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFooterRowColorObject(color)

设置条带化中页脚行的颜色。

参数

名称类型说明
colorColor新的页脚行颜色;设置为 null 可清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setHeaderColumnColor(color)

设置标题列的颜色。

参数

名称类型说明
colorString采用 CSS 表示法的颜色代码(例如 '#ffffff''white'),或 null 以清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setHeaderColumnColorObject(color)

设置标题列的颜色。

参数

名称类型说明
colorColor新的标题列颜色;设置为 null 可清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setHeaderRowColor(color)

设置标题行的颜色。

参数

名称类型说明
colorString采用 CSS 表示法的颜色代码(例如 '#ffffff''white'),或 null 以清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setHeaderRowColorObject(color)

设置标题行的颜色。

参数

名称类型说明
colorColor新的标题行颜色;设置为 null 可清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setRange(range)

为此条带设置范围。

参数

名称类型说明
rangeRange相应频段的新范围。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setSecondColumnColor(color)

设置交替的第二列颜色。

参数

名称类型说明
colorString采用 CSS 表示法的颜色代码(例如 '#ffffff''white'),或 null 以清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setSecondColumnColorObject(color)

设置条带中的第二个交替列颜色。

参数

名称类型说明
colorColor带状图中的新第二种交替列颜色;设置为 null 可清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setSecondRowColor(color)

设置交替的第二行颜色。

参数

名称类型说明
colorString采用 CSS 表示法的颜色代码(例如 '#ffffff''white'),或 null 以清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setSecondRowColorObject(color)

设置条带中的第二种交替颜色。

参数

名称类型说明
colorColor条带中的新第二种交替颜色;设置为 null 可清除颜色。

返回

Banding - 此频段,用于链式调用。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

已弃用的方法