Class Banding

Banding

Access and modify bandings, the color patterns applied to rows or columns of a range. Each banding consists of a range and a set of colors for rows, columns, headers, and footers.

Methods

MethodReturn typeBrief description
copyTo(range)BandingCopies this banding to another range.
getFirstColumnColor()StringReturns the first column color that is alternating, or null if no color is set.
getFirstRowColor()StringReturns the first row color that is alternating or null if no color is set.
getFooterColumnColor()StringReturns the color of the last column, or null if no color is set.
getFooterRowColor()StringReturns the color of the last row, or null if no color is set.
getHeaderColumnColor()StringReturns the color of the header column, or null if no color is set.
getHeaderRowColor()StringReturns the color of the header row or null if no color is set.
getRange()RangeReturns the range for this banding.
getSecondColumnColor()StringReturns the second column color that is alternating, or null if no color is set.
getSecondRowColor()StringReturns the second row color that is alternating or null if no color is set.
remove()voidRemoves this banding.
setFirstColumnColor(color)BandingSets the first column color that is alternating.
setFirstRowColor(color)BandingSets the first row color that is alternating.
setFooterColumnColor(color)BandingSets the color of the last column.
setFooterRowColor(color)BandingSets the color of the last row.
setHeaderColumnColor(color)BandingSets the color of the header column.
setHeaderRowColor(color)BandingSets the color of the header row.
setRange(range)BandingSets the range for this banding.
setSecondColumnColor(color)BandingSets the second column color that is alternating.
setSecondRowColor(color)BandingSets the second row color that is alternating.

Detailed documentation

copyTo(range)

Copies this banding to another range.

Parameters

NameTypeDescription
rangeRangeThe range to copy this banding to.

Return

Banding — the new banding

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getFirstColumnColor()

Returns the first column color that is alternating, or null if no color is set.

Return

String — the color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getFirstRowColor()

Returns the first row color that is alternating or null if no color is set.

Return

String — the color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getFooterColumnColor()

Returns the color of the last column, or null if no color is set.

Return

String — the color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getFooterRowColor()

Returns the color of the last row, or null if no color is set.

Return

String — the color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getHeaderColumnColor()

Returns the color of the header column, or null if no color is set.

Return

String — the color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getHeaderRowColor()

Returns the color of the header row or null if no color is set.

Return

String — the color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getRange()

Returns the range for this banding.

Return

Range — the range for this banding

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getSecondColumnColor()

Returns the second column color that is alternating, or null if no color is set.

Return

String — the HEX color or null if no color is set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

getSecondRowColor()

Returns the second row color that is alternating or null if no color is set.

Return

String — the color code in CSS notation (such as '#ffffff' or 'white'), or null if no color is set

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

remove()

Removes this banding.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setFirstColumnColor(color)

Sets the first column color that is alternating.

Parameters

NameTypeDescription
colorStringThe color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color..

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setFirstRowColor(color)

Sets the first row color that is alternating.

Parameters

NameTypeDescription
colorStringThe color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setFooterColumnColor(color)

Sets the color of the last column.

Parameters

NameTypeDescription
colorStringThe color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setFooterRowColor(color)

Sets the color of the last row.

Parameters

NameTypeDescription
colorStringThe color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setHeaderColumnColor(color)

Sets the color of the header column.

Parameters

NameTypeDescription
colorStringThe color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setHeaderRowColor(color)

Sets the color of the header row.

Parameters

NameTypeDescription
colorStringThe color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setRange(range)

Sets the range for this banding.

Parameters

NameTypeDescription
rangeRangeThe new range for this banding.

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setSecondColumnColor(color)

Sets the second column color that is alternating.

Parameters

NameTypeDescription
colorStringThe color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

setSecondRowColor(color)

Sets the second row color that is alternating.

Parameters

NameTypeDescription
colorStringThe color code in CSS notation (such as '#ffffff' or 'white'), or null to clear the color.

Return

Banding — this banding, for chaining

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

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

Enviar comentários sobre…

Precisa de ajuda? Acesse nossa página de suporte.