> ## Documentation Index
> Fetch the complete documentation index at: https://gocharting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# table functions

> Reference for the 23 functions of the table namespace: table.all, table.cell, table.cell_set_bgcolor, table.cell_set_height and 19 more, each with its definition and an example.

> [!NOTE]
>
> Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: table · Entries: 24

## `table` (library)

**Definition**

Functions for screen-anchored tables. Create with table.new, fill cells with table.cell, merge with table.merge\_cells. One table per position.\*; a later table.new at the same position deletes the older table. Maximum of 9 tables.

**Notes**

* A `table.<name>(t, ...)` function can also be called on the table as `t.<name>(...)`, for example `t.cell(0, 0, "a")`.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table Library Example", overlay=true)
if barstate.islast {
    t = table.new(position.top_right, 2, 2, bgcolor=color.gray, border_width=1, border_color=color.black)
    table.cell(t, 0, 0, text="High", textcolor=color.white)
    table.cell(t, 1, 0, text=str.tostring(high), textcolor=color.white)
    table.cell(t, 0, 1, text="Low", textcolor=color.white)
    table.cell(t, 1, 1, text=str.tostring(low), textcolor=color.white)
}
```

## `table.all` (function)

**Definition**

Returns the array of all existing table objects (same as the table.all variable). One live table per position.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.all() → series array<table>
```

**Returns**

`series array<table>`

An array of table IDs, oldest to newest.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.all Function Example")
plot(array.length(table.all), title="Tables")
```

## `table.cell` (function)

**Definition**

Defines a cell at (column, row). If that cell was previously merged as an origin, its colspan/rowspan is kept. Covered cells from a merge are not created as placeholders.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell(series table id, series int column, series int row, series string text, series float width, series float height, series color textcolor, series string texthalign, series string textvalign, series size size, series color bgcolor, series string tooltip, input font text_font_family, series string text_formatting) → void
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `id` | `series table` | yes | Table object. | | |
| `column` | `series int` | yes | 0-based column index. | | |
| `row` | `series int` | yes | 0-based row index. | | |
| `text` | `series string` | no | Cell text. Default is an empty string. | | `""` |
| `width` | `series float` | no | Cell width as a percentage of the pane. Default is 0 (auto). | | `0` |
| `height` | `series float` | no | Cell height as a percentage of the pane. Default is 0 (auto). | | `0` |
| `textcolor` | `series color` | no | Text color. Optional. The old name `text_color` still compiles for now, with a deprecation warning. | | `na` |
| `texthalign` | `series string` | no | Horizontal text align: left, center, or right. Default is center. The old name `text_halign` still compiles for now, with a deprecation warning. | `text.align_left`, `text.align_center`, `text.align_right` | `"center"` |
| `textvalign` | `series string` | no | Vertical text align: top, center, or bottom. Default is center. The old name `text_valign` still compiles for now, with a deprecation warning. | `text.align_top`, `text.align_center`, `text.align_bottom` | `"center"` |
| `size` | `series size` | no | Cell text size (`size.auto`, `size.tiny` … `size.huge`). Optional. Default is `size.normal`. The old name `text_size` still compiles for now, with a deprecation warning. | | `size.normal` |
| `bgcolor` | `series color` | no | Cell background color. Optional. | | `na` |
| `tooltip` | `series string` | no | Tooltip text. Default is an empty string. | | `""` |
| `text_font_family` | `input font` | no | Font family (`font.family_default` or `font.family_monospace`). Optional. Default is `font.family_default`. | | `font.family_default` |
| `text_formatting` | `series string` | no | Text formatting. Default is none. | `text.format_bold`, `text.format_italic`, `text.format_none` | `"none"` |

**Returns**

`void`

void

**Notes**

* The `size` argument takes a `size.*` constant (`size.auto`, `size.tiny`, `size.small`, `size.normal`, `size.large`, `size.huge`). A string such as "small" still compiles, with a deprecation warning: write the constant.
* The old names `text_color`, `text_halign`, `text_valign` and `text_size` still compile, with a deprecation warning that names the new spelling (`textcolor`, `texthalign`, `textvalign`, `size`). Giving both spellings of one argument is an error. Write the new names.
* A string that is not a size name, such as "giant", stops the compiler with the error "internal validator error": write a `size.*` constant.

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.merge_cells example")
SMA50 = talib.sma(close, 50)
SMA100 = talib.sma(close, 100)
SMA200 = talib.sma(close, 200)
if barstate.islast {
    maTable = table.new(position.bottom_right, 3, 3, bgcolor=color.gray, border_width=1, border_color=color.black)
    table.cell(maTable, 0, 0, text="SMA Table")
    table.merge_cells(maTable, 0, 0, 2, 0)
    table.cell(maTable, 0, 1, text="SMA 50")
    table.cell(maTable, 1, 1, text="SMA 100")
    table.cell(maTable, 2, 1, text="SMA 200")
    table.cell(maTable, 0, 2, bgcolor=color.white, text=str.tostring(SMA50))
    table.cell(maTable, 1, 2, bgcolor=color.white, text=str.tostring(SMA100))
    table.cell(maTable, 2, 2, bgcolor=color.white, text=str.tostring(SMA200))
}
```

## `table.cell_set_bgcolor` (function)

**Definition**

Sets the background color of an existing cell. No-op if the cell does not exist.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_bgcolor(series table id, series int column, series int row, series color color) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `column` | `series int` | yes | 0-based column. |
| `row` | `series int` | yes | 0-based row. |
| `color` | `series color` | yes | New cell background color. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_bgcolor Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hi")
    table.cell_set_bgcolor(t, 0, 0, color.green)
}
```

## `table.cell_set_height` (function)

**Definition**

Sets the height of an existing cell as a percentage of the pane.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_height(series table id, series int column, series int row, series float height) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `column` | `series int` | yes | 0-based column. |
| `row` | `series int` | yes | 0-based row. |
| `height` | `series float` | yes | Height as a percentage of the pane. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_height Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hello")
    table.cell_set_height(t, 0, 0, 5)
}
```

## `table.cell_set_text` (function)

**Definition**

Sets the text of an existing cell. No-op if the cell does not exist.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_text(series table id, series int column, series int row, series string text) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `column` | `series int` | yes | 0-based column. |
| `row` | `series int` | yes | 0-based row. |
| `text` | `series string` | yes | New cell text. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_text Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="")
    table.cell_set_text(t, 0, 0, str.tostring(close))
}
```

## `table.cell_set_text_color` (function)

**Definition**

Sets the text color of an existing cell.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_text_color(series table id, series int column, series int row, series color color) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `column` | `series int` | yes | 0-based column. |
| `row` | `series int` | yes | 0-based row. |
| `color` | `series color` | yes | New text color. The old name `text_color` still compiles for now, with a deprecation warning. |

**Returns**

`void`

void

**Notes**

* The old name `text_color` still compiles, with a deprecation warning that names `color`. Write the new name.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_text_color Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text=str.tostring(close))
    table.cell_set_text_color(t, 0, 0, color.white)
}
```

## `table.cell_set_text_font_family` (function)

**Definition**

Sets the font family of an existing cell.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_text_font_family(series table id, series int column, series int row, input font text_font_family) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `column` | `series int` | yes | 0-based column. |
| `row` | `series int` | yes | 0-based row. |
| `text_font_family` | `input font` | yes | Font family (`font.family_default` or `font.family_monospace`). |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_text_font_family Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hello")
    table.cell_set_text_font_family(t, 0, 0, font.family_default)
}
```

## `table.cell_set_text_formatting` (function)

**Definition**

Sets text formatting of an existing cell (for example none, bold, italic).

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_text_formatting(series table id, series int column, series int row, series string text_formatting) → void
```

**Parameters**

| Name | Type | Required | Description | Values |
| - | - | - | - | - |
| `id` | `series table` | yes | Table object. | |
| `column` | `series int` | yes | 0-based column. | |
| `row` | `series int` | yes | 0-based row. | |
| `text_formatting` | `series string` | yes | Formatting string. | `text.format_bold`, `text.format_italic`, `text.format_none` |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_text_formatting Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hello")
    table.cell_set_text_formatting(t, 0, 0, "bold")
}
```

## `table.cell_set_text_halign` (function)

**Definition**

Sets horizontal text alignment of an existing cell: left, center, or right.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_text_halign(series table id, series int column, series int row, series string texthalign) → void
```

**Parameters**

| Name | Type | Required | Description | Values |
| - | - | - | - | - |
| `id` | `series table` | yes | Table object. | |
| `column` | `series int` | yes | 0-based column. | |
| `row` | `series int` | yes | 0-based row. | |
| `texthalign` | `series string` | yes | Horizontal alignment: left, center, or right. The old name `text_halign` still compiles for now, with a deprecation warning. | `text.align_left`, `text.align_center`, `text.align_right` |

**Returns**

`void`

void

**Notes**

* The old name `text_halign` still compiles, with a deprecation warning that names `texthalign`. Write the new name.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_text_halign Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hello")
    table.cell_set_text_halign(t, 0, 0, "left")
}
```

## `table.cell_set_text_size` (function)

**Definition**

Sets the text size of an existing cell.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_text_size(series table id, series int column, series int row, series size size) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `column` | `series int` | yes | 0-based column. |
| `row` | `series int` | yes | 0-based row. |
| `size` | `series size` | yes | Text size (`size.auto`, `size.tiny` … `size.huge`). The old name `text_size` still compiles for now, with a deprecation warning. |

**Returns**

`void`

void

**Notes**

* The `size` argument takes a `size.*` constant (`size.auto`, `size.tiny`, `size.small`, `size.normal`, `size.large`, `size.huge`). A string such as "small" still compiles, with a deprecation warning: write the constant.
* The old name `text_size` still compiles, with a deprecation warning that names `size`. Write the new name.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_text_size Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hello")
    table.cell_set_text_size(t, 0, 0, size.large)
}
```

## `table.cell_set_text_valign` (function)

**Definition**

Sets vertical text alignment of an existing cell: top, center, or bottom.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_text_valign(series table id, series int column, series int row, series string textvalign) → void
```

**Parameters**

| Name | Type | Required | Description | Values |
| - | - | - | - | - |
| `id` | `series table` | yes | Table object. | |
| `column` | `series int` | yes | 0-based column. | |
| `row` | `series int` | yes | 0-based row. | |
| `textvalign` | `series string` | yes | Vertical alignment: top, center, or bottom. The old name `text_valign` still compiles for now, with a deprecation warning. | `text.align_top`, `text.align_center`, `text.align_bottom` |

**Returns**

`void`

void

**Notes**

* The old name `text_valign` still compiles, with a deprecation warning that names `textvalign`. Write the new name.

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_text_valign Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hello")
    table.cell_set_text_valign(t, 0, 0, "top")
}
```

## `table.cell_set_tooltip` (function)

**Definition**

Sets the tooltip of an existing cell.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_tooltip(series table id, series int column, series int row, series string tooltip) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `column` | `series int` | yes | 0-based column. |
| `row` | `series int` | yes | 0-based row. |
| `tooltip` | `series string` | yes | Tooltip text. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_tooltip Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text=str.tostring(close))
    table.cell_set_tooltip(t, 0, 0, "Last close")
}
```

## `table.cell_set_width` (function)

**Definition**

Sets the width of an existing cell as a percentage of the pane.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.cell_set_width(series table id, series int column, series int row, series float width) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `column` | `series int` | yes | 0-based column. |
| `row` | `series int` | yes | 0-based row. |
| `width` | `series float` | yes | Width as a percentage of the pane. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.cell_set_width Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hello")
    table.cell_set_width(t, 0, 0, 10)
}
```

## `table.clear` (function)

**Definition**

Removes cells in the inclusive rectangle. `end_column` and `end_row` are required; leaving either out is an error. Clearing a merge origin drops that merge.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.clear(series table id, series int start_column, series int start_row, series int end_column, series int end_row) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `start_column` | `series int` | yes | Column of one corner (0-based). |
| `start_row` | `series int` | yes | Row of one corner (0-based). |
| `end_column` | `series int` | yes | Column of the opposite corner (0-based). Required argument. |
| `end_row` | `series int` | yes | Row of the opposite corner (0-based). Required argument. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.clear Example")
if barstate.islast {
    t = table.new(position.top_right, 2, 2)
    table.cell(t, 0, 0, text="A")
    table.cell(t, 1, 0, text="B")
    table.clear(t, 0, 0, 1, 0)
}
```

## `table.delete` (function)

**Definition**

Deletes a table. The position slot becomes empty.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.delete(series table id) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object to delete. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.delete Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Bye")
    table.delete(t)
}
```

## `table.merge_cells` (function)

**Definition**

Merges the inclusive rectangle from (start\_column, start\_row) to (end\_column, end\_row) into the top-left origin cell. That cell gets colspan/rowspan; other cells in the rect are removed. Corners may be passed in any order. A later overlapping merge clears the old origin span.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.merge_cells(series table id, series int start_column, series int start_row, series int end_column, series int end_row) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `start_column` | `series int` | yes | Column of one corner of the merge rect (0-based). |
| `start_row` | `series int` | yes | Row of one corner of the merge rect (0-based). |
| `end_column` | `series int` | yes | Column of the opposite corner (0-based). |
| `end_row` | `series int` | yes | Row of the opposite corner (0-based). |

**Returns**

`void`

void

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.merge_cells example")
SMA50 = talib.sma(close, 50)
SMA100 = talib.sma(close, 100)
SMA200 = talib.sma(close, 200)
if barstate.islast {
    maTable = table.new(position.bottom_right, 3, 3, bgcolor=color.gray, border_width=1, border_color=color.black)
    table.cell(maTable, 0, 0, text="SMA Table")
    table.merge_cells(maTable, 0, 0, 2, 0)
    table.cell(maTable, 0, 1, text="SMA 50")
    table.cell(maTable, 1, 1, text="SMA 100")
    table.cell(maTable, 2, 1, text="SMA 200")
    table.cell(maTable, 0, 2, bgcolor=color.white, text=str.tostring(SMA50))
    table.cell(maTable, 1, 2, bgcolor=color.white, text=str.tostring(SMA100))
    table.cell(maTable, 2, 2, bgcolor=color.white, text=str.tostring(SMA200))
}
```

## `table.new` (function)

**Definition**

Creates a new table at a chart position. If a table already exists at that position, the previous table is deleted. At most 9 tables can exist (one per position.\*).

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.new(series string position, series int columns, series int rows, series color bgcolor, series color frame_color, series int frame_width, series color border_color, series int border_width, const bool force_overlay) → series table
```

**Parameters**

| Name | Type | Required | Description | Values | Default |
| - | - | - | - | - | - |
| `position` | `series string` | yes | Where to place the table. One of position.top\_left, top\_center, top\_right, middle\_left, middle\_center, middle\_right, bottom\_left, bottom\_center, bottom\_right. | `position.bottom_center`, `position.bottom_left`, `position.bottom_right`, `position.middle_center`, `position.middle_left`, `position.middle_right`, `position.top_center`, `position.top_left`, `position.top_right` | |
| `columns` | `series int` | yes | Number of columns. Must be >= 1. | | |
| `rows` | `series int` | yes | Number of rows. Must be >= 1. | | |
| `bgcolor` | `series color` | no | Background color of the table. Optional. | | `na` |
| `frame_color` | `series color` | no | Outer frame color. Optional. | | `na` |
| `frame_width` | `series int` | no | Outer frame width in pixels. Default is 0. | | `0` |
| `border_color` | `series color` | no | Inner cell-border color. Optional. | | `na` |
| `border_width` | `series int` | no | Inner cell-border width in pixels. Default is 0. | | `0` |
| `force_overlay` | `const bool` | no | If true, draw on the main pane even when the script is not overlay. Default is false. | | `false` |

**Returns**

`series table`

The ID of the created table, or na if columns/rows are less than 1.

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.merge_cells example")
SMA50 = talib.sma(close, 50)
SMA100 = talib.sma(close, 100)
SMA200 = talib.sma(close, 200)
if barstate.islast {
    maTable = table.new(position.bottom_right, 3, 3, bgcolor=color.gray, border_width=1, border_color=color.black)
    table.cell(maTable, 0, 0, text="SMA Table")
    table.merge_cells(maTable, 0, 0, 2, 0)
    table.cell(maTable, 0, 1, text="SMA 50")
    table.cell(maTable, 1, 1, text="SMA 100")
    table.cell(maTable, 2, 1, text="SMA 200")
    table.cell(maTable, 0, 2, bgcolor=color.white, text=str.tostring(SMA50))
    table.cell(maTable, 1, 2, bgcolor=color.white, text=str.tostring(SMA100))
    table.cell(maTable, 2, 2, bgcolor=color.white, text=str.tostring(SMA200))
}
```

## `table.set_bgcolor` (function)

**Definition**

Sets the table background color.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.set_bgcolor(series table id, series color color) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `color` | `series color` | yes | New table background color. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.set_bgcolor Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hi")
    table.set_bgcolor(t, color.navy)
}
```

## `table.set_border_color` (function)

**Definition**

Sets the inner cell-border color.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.set_border_color(series table id, series color color) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `color` | `series color` | yes | New border color. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.set_border_color Example")
if barstate.islast {
    t = table.new(position.top_right, 2, 1, border_width=1)
    table.cell(t, 0, 0, text="A")
    table.cell(t, 1, 0, text="B")
    table.set_border_color(t, color.black)
}
```

## `table.set_border_width` (function)

**Definition**

Sets the inner cell-border width in pixels.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.set_border_width(series table id, series int width) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `width` | `series int` | yes | Border width in pixels. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.set_border_width Example")
if barstate.islast {
    t = table.new(position.top_right, 2, 1)
    table.cell(t, 0, 0, text="A")
    table.cell(t, 1, 0, text="B")
    table.set_border_width(t, 1)
}
```

## `table.set_frame_color` (function)

**Definition**

Sets the outer frame color.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.set_frame_color(series table id, series color color) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `color` | `series color` | yes | New frame color. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.set_frame_color Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1, frame_width=1)
    table.cell(t, 0, 0, text="Hi")
    table.set_frame_color(t, color.white)
}
```

## `table.set_frame_width` (function)

**Definition**

Sets the outer frame width in pixels.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.set_frame_width(series table id, series int width) → void
```

**Parameters**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `series table` | yes | Table object. |
| `width` | `series int` | yes | Frame width in pixels. |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.set_frame_width Example")
if barstate.islast {
    t = table.new(position.top_right, 1, 1)
    table.cell(t, 0, 0, text="Hi")
    table.set_frame_width(t, 2)
}
```

## `table.set_position` (function)

**Definition**

Moves a table to a new position. If another table already occupies that position, it is deleted. The previous slot is left empty.

**Syntax**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
table.set_position(series table id, series string position) → void
```

**Parameters**

| Name | Type | Required | Description | Values |
| - | - | - | - | - |
| `id` | `series table` | yes | Table object. | |
| `position` | `series string` | yes | New position.\* value. | `position.bottom_center`, `position.bottom_left`, `position.bottom_right`, `position.middle_center`, `position.middle_left`, `position.middle_right`, `position.top_center`, `position.top_left`, `position.top_right` |

**Returns**

`void`

void

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("table.set_position Example")
if barstate.islast {
    t = table.new(position.top_left, 1, 1)
    table.cell(t, 0, 0, text="Moved")
    table.set_position(t, position.bottom_right)
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.