---
Product: Aspose.Slides
Platform: java
Page Type: reference
Canonical URL: https://reference.aspose.org/slides/java/cell
---

# Cell

## Overview

`Cell` is a class in Aspose.Slides FOSS for Java.
Inherits from: `ICell`, `ISlideComponent`, `IPresentationComponent`.

Represents a cell of a table.

This class declares 41 methods for Cell objects in Java programs.
Available methods include: `Cell`, `asIPresentationComponent`, `ensureTcPr`, `getAsIPresentationComponent`, `getAsISlideComponent`, `getCellFormat`, `getColSpan`, `getFirstColumn`, `getFirstColumnIndex`, `getFirstRow`, `getFirstRowIndex`, `getHeight`, and 27 additional methods.
Public members are accessible to any Java application after installing the Aspose.Slides FOSS for Java package.
Properties: `anchorCenter`, `asIPresentationComponent`, `asISlideComponent`, `cellFormat`, `colSpan`, `firstColumn`, and 22 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `tcPr` | `Element` | Read | Returns the {@code } child element of the backing {@code } element. |
| `offsetX` | `double` | Read | Gets the offset x. |
| `offsetY` | `double` | Read | Gets the offset y. |
| `firstRowIndex` | `int` | Read | Gets the first row index. |
| `firstColumnIndex` | `int` | Read | Gets the first column index. |
| `width` | `double` | Read | Gets the width. |
| `height` | `double` | Read | Gets the height. |
| `minimalHeight` | `double` | Read | Gets the minimal height. |
| `marginLeft` | `double` | Read/Write | Gets or sets the margin left. |
| `marginRight` | `double` | Read/Write | Gets or sets the margin right. |
| `marginTop` | `double` | Read/Write | Gets or sets the margin top. |
| `marginBottom` | `double` | Read/Write | Gets or sets the margin bottom. |
| `textVerticalType` | `TextVerticalType` | Read/Write | Gets or sets the text vertical type. |
| `textAnchorType` | `TextAnchorType` | Read/Write | Gets or sets the text anchor type. |
| `anchorCenter` | `boolean` | Read/Write | Gets or sets the anchor center. |
| `firstRow` | `IRow` | Read | Gets the first row. |
| `firstColumn` | `IColumn` | Read | Gets the first column. |
| `colSpan` | `int` | Read | Gets the col span. |
| `rowSpan` | `int` | Read | Gets the row span. |
| `textFrame` | `ITextFrame` | Read | Gets the text frame. |
| `table` | `ITable` | Read | Gets the table. |
| `mergedCell` | `boolean` | Read | Gets the merged cell. |
| `cellFormat` | `ICellFormat` | Read | Gets the cell format. |
| `slide` | `IBaseSlide` | Read | Gets the slide. |
| `presentation` | `IPresentation` | Read | Gets the presentation. |
| `tcElement` | `Element` | Read | Returns the underlying {@code } XML element. |
| `asISlideComponent` | `ISlideComponent` | Read | Gets the as i slide component. |
| `asIPresentationComponent` | `IPresentationComponent` | Read | Gets the as i presentation component. |

## Methods

| Signature | Description |
|-----------|-------------|
| `Cell()` | Creates an empty {@code Cell} with no backing element. |
| `Cell(tcElement: Element, rowIndex: int, colIndex: int, saveCallback: Runnable, parentSlide: IBaseSlide, table: ITable)` | Creates a new Cell backed by the given {@code } element. |
| `Cell(tcElement: Element, saveCallback: Runnable)` | Creates a new Cell backed by the given {@code } element. |
| `initInternal(tcElement: Element, rowIndex: int, colIndex: int, saveCallback: Runnable, parentSlide: IBaseSlide, table: ITable)` → `Cell` | Initializes this cell from the given {@code } element and table context. |
| `getTcPr()` → `Element` | Returns the {@code } child element of the backing {@code } element. |
| `ensureTcPr()` → `Element` | Returns the {@code } child element, creating it if absent. |
| `getOffsetX()` → `double` | Returns the offset x. |
| `getOffsetY()` → `double` | Returns the offset y. |
| `getFirstRowIndex()` → `int` | Returns the first row index. |
| `getFirstColumnIndex()` → `int` | Returns the first column index. |
| `getWidth()` → `double` | Returns the width. |
| `getHeight()` → `double` | Returns the height. |
| `getMinimalHeight()` → `double` | Returns the minimal height. |
| `getMarginLeft()` → `double` | Returns the margin left. |
| `setMarginLeft(value: double)` | Sets the margin left value. |
| `getMarginRight()` → `double` | Returns the margin right. |
| `setMarginRight(value: double)` | Sets the margin right value. |
| `getMarginTop()` → `double` | Returns the margin top. |
| `setMarginTop(value: double)` | Sets the margin top value. |
| `getMarginBottom()` → `double` | Returns the margin bottom. |
| `setMarginBottom(value: double)` | Sets the margin bottom value. |
| `getTextVerticalType()` → `TextVerticalType` | Returns the text vertical type. |
| `setTextVerticalType(value: TextVerticalType)` | Sets the text vertical type value. |
| `getTextAnchorType()` → `TextAnchorType` | Returns the text anchor type. |
| `setTextAnchorType(value: TextAnchorType)` | Sets the text anchor type value. |
| `isAnchorCenter()` → `boolean` | Returns true if anchor center is set. |
| `setAnchorCenter(value: boolean)` | Sets the anchor center value. |
| `getFirstRow()` → `IRow` | Returns the first row. |
| `getFirstColumn()` → `IColumn` | Returns the first column. |
| `getColSpan()` → `int` | Returns the col span. |
| `getRowSpan()` → `int` | Returns the row span. |
| `getTextFrame()` → `ITextFrame` | Returns the text frame. |
| `getTable()` → `ITable` | Returns the table. |
| `isMergedCell()` → `boolean` | Returns true if merged cell is set. |
| `getCellFormat()` → `ICellFormat` | Returns the cell format. |
| `getSlide()` → `IBaseSlide` | Returns the slide. |
| `getPresentation()` → `IPresentation` | Returns the presentation. |
| `getTcElement()` → `Element` | Returns the underlying {@code } XML element. |
| `getAsISlideComponent()` → `ISlideComponent` | Returns the as i slide component. |
| `getAsIPresentationComponent()` → `IPresentationComponent` | Returns the as i presentation component. |
| `asIPresentationComponent()` → `IPresentationComponent` | Calls asIPresentationComponent on this Cell instance. |

## See Also

- [Aspose.Slides — Enterprise API Reference](https://reference.aspose.com/slides/)