Class TableCell

  • TableCell represents a single cell within a table structure.

  • Methods are available to retrieve information about the cell's position, span, content alignment, fill, merge state, and parent elements.

  • You can get the text content of a TableCell using thegetText() method.

  • The content alignment of the text within a TableCell can be set using thesetContentAlignment() method.

  • All methods for TableCell require specific authorization scopes related to presentations.

TableCell

A cell in a table.

Methods

MethodReturn typeBrief description
getColumnIndex()IntegerReturns the 0-based column index of the table cell.
getColumnSpan()IntegerReturns the column span of the table cell.
getContentAlignment()ContentAlignmentReturns theContentAlignment of the text in the table cell.
getFill()FillReturns the fill of the table cell.
getHeadCell()TableCell|nullReturns the head cell of this table cell.
getMergeState()CellMergeStateReturns the merge state of the table cell.
getParentColumn()TableColumnReturns the table column containing the current cell.
getParentRow()TableRowReturns the table row containing the current cell.
getParentTable()TableReturns the table containing the current cell.
getRowIndex()IntegerReturns the 0-based row index of the table cell.
getRowSpan()IntegerReturns the row span of the table cell.
getText()TextRangeReturns the text content of the table cell.
setContentAlignment(contentAlignment)TableCellSets theContentAlignment of the text in the table cell.

Detailed documentation

getColumnIndex()

Returns the 0-based column index of the table cell.

Return

Integer

Authorization

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

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

getColumnSpan()

Returns the column span of the table cell.

Return

Integer

Authorization

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

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

getContentAlignment()

Returns theContentAlignment of the text in the table cell.

Return

ContentAlignment

Authorization

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

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

getFill()

Returns the fill of the table cell.

Return

Fill

Authorization

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

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

getHeadCell()

Returns the head cell of this table cell. Returnsnull if this cell has not been mergedor if this cell is the head cell.

Return

TableCell|null

Authorization

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

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

getMergeState()

Returns the merge state of the table cell.

Return

CellMergeState

Authorization

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

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

getParentColumn()

Returns the table column containing the current cell.

Return

TableColumn

Authorization

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

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

getParentRow()

Returns the table row containing the current cell.

Return

TableRow

Authorization

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

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

getParentTable()

Returns the table containing the current cell.

Return

Table

Authorization

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

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

getRowIndex()

Returns the 0-based row index of the table cell.

Return

Integer

Authorization

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

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

getRowSpan()

Returns the row span of the table cell.

Return

Integer

Authorization

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

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

getText()

Returns the text content of the table cell. Returnsnull if the cell is merged but isnot a head cell.

Text within a table cell always terminates with a newline character.

Return

TextRange

Authorization

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

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

setContentAlignment(contentAlignment)

Sets theContentAlignment of the text in the table cell.

Parameters

NameTypeDescription
contentAlignmentContentAlignment

Return

TableCell

Authorization

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

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

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.