---
title: UITableCell
description: Cell in a UITableRow.
---

Cell in a UITableRow.

Cells are shown horizontally in a UITableRow which in turn is shown
vertically in a UITable. Cells have content, e.g. a text or an image.

## Properties

### dismissOnTap

Whether to dismiss the table when the button is tapped.

```typescript
dismissOnTap: bool
```

Defaults to false.

### onTap

Called when the button is tapped.

```typescript
onTap: fn()
```

Buttons cannot be tapped when the table is presented in Siri.

### subtitleColor

Color of the subtitle.

```typescript
subtitleColor: Color
```

This only has an effect on cells with a subtitle. By default the color is null, in which case an appropriate color is automatically chosen based on the theme of the app and the context the script is running in.

### subtitleFont

Font of the subtitle.

```typescript
subtitleFont: Font
```

### titleColor

Color of the title.

```typescript
titleColor: Color
```

This only has an effect on cells with a title. By default the color is null, in which case an appropriate color is automatically chosen based on the theme of the app and the context the script is running in.

### titleFont

Font of the title.

```typescript
titleFont: Font
```

### widthWeight

Relative width of the cell.

```typescript
widthWeight: number
```

A width weight specifies the relative width of the cell. When computing the absolute width of the cell, all width weights are taken into account. Consider the following example.

Cell A has a width weight of 50.
Cell B has a width weight of 100.
Cell C has a width wegiht of 150.

Assume that the row has an absolute width of 100. The width will be distributed among cells A, B and C. B will be double as wide as A but C will be fifty percent wider than B and three times as wide as A.

## Methods

<span id="button" class="api-anchor"></span>

### button(title)

Constructs a button cell.

```typescript
static button(title: string): UITableCell
```

Constructs a new cell that contains a button. Set the `onTap` property to specify an action to performed when the button is tapped.

#### Parameters

**`title` `string`**

Title of the button.

#### Return value

**`UITableCell`**

Constructed cell.

<span id="-centeraligned" class="api-anchor"></span>

### centerAligned()

Center aligns content.

```typescript
centerAligned()
```

Specifies that content in the cell should be center aligned.

<span id="image" class="api-anchor"></span>

### image(image)

Constructs an image cell.

```typescript
static image(image: Image): UITableCell
```

Constructs a new cell containing an image.

#### Parameters

**`image` `Image`**

Image to show in the cell.

#### Return value

**`UITableCell`**

Constructed cell.

<span id="imageaturl" class="api-anchor"></span>

### imageAtURL(url)

Constructs an image cell.

```typescript
static imageAtURL(url: string): UITableCell
```

Constructs a new cell that loads the image at the specified URL.

#### Parameters

**`url` `string`**

URL to image.

#### Return value

**`UITableCell`**

Constructed cell.

<span id="-leftaligned" class="api-anchor"></span>

### leftAligned()

Left aligns content.

```typescript
leftAligned()
```

Specifies that content in the cell should be left aligned.

<span id="-rightaligned" class="api-anchor"></span>

### rightAligned()

Right aligns content.

```typescript
rightAligned()
```

Specifies that content in the cell should be right aligned.

<span id="text" class="api-anchor"></span>

### text(title, subtitle)

Constructs a text cell.

```typescript
static text(title: string, subtitle: string): UITableCell
```

Constructs a new cell containing text.

#### Parameters

**`title` `string`**

Optional title to show in the cell.

**`subtitle` `string`**

Optional subtitle shown below the title.

#### Return value

**`UITableCell`**

Constructed cell.