Skip to content

Table ​

Handle for a table drawing.

Static Methods ​

new ​

navi
new(
    position: series Position,
    columns: series int,
    rows: series int,
    bg_color: series Color = na,
    frame_color: series Color = na,
    frame_width: series int = 0,
    border_color: series Color = na,
    border_width: series int = 0,
    force_overlay: series bool = false
  ): series Table

Creates a table object on the chart.

Parameters

NameTypeDefaultDescription
positionseries PositionThe position of the table on the chart (e.g., position.top_left, position.top_center, etc.).
columnsseries intThe number of columns in the table.
rowsseries intThe number of rows in the table.
bg_colorseries ColornaThe background color of the table.
frame_colorseries ColornaThe frame border color of the table.
frame_widthseries int0The frame border width in pixels.
border_colorseries ColornaThe table border color.
border_widthseries int0The table border width in pixels.
force_overlayseries boolfalseIf true, the table is rendered on top.

Returns: series Table

Static Properties ​

all ​

Type: series Array<Table>

Returns an array filled with all the current tables drawn by the script.

Methods ​

cell ​

Sets the properties of a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
textseries StringnaThe text content of the cell.
widthseries float0The width of the cell in pixels.
heightseries float0The height of the cell in pixels.
text_colorseries ColorColor.BLACKThe text color.
text_halignseries TextHAlignTextHAlign.CenterThe horizontal text alignment.
text_valignseries TextVAlignTextVAlign.CenterThe vertical text alignment.
text_sizeseries int14The text size in pixels.
bg_colorseries ColornaThe background color of the cell.
tooltipseries StringnaThe tooltip text for the cell.
text_font_familyseries FontFamilyFontFamily.DefaultThe font family for the text.
text_formattingconst TextFormatTextFormat.NONEThe text formatting options.

Sets the properties of a specific cell in a table.

Overload with text size as named constant.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
textseries StringnaThe text content of the cell.
widthseries float0The width of the cell in pixels.
heightseries float0The height of the cell in pixels.
text_colorseries ColorColor.BLACKThe text color.
text_halignseries TextHAlignTextHAlign.CenterThe horizontal text alignment.
text_valignseries TextVAlignTextVAlign.CenterThe vertical text alignment.
text_sizeseries SizeSize.AutoThe text size as a named constant.
bg_colorseries ColornaThe background color of the cell.
tooltipseries StringnaThe tooltip text for the cell.
text_font_familyseries FontFamilyFontFamily.DefaultThe font family for the text.
text_formattingconst TextFormatTextFormat.NONEThe text formatting options.

cell_set_bg_color ​

navi
cell_set_bg_color(
    table_id: series Table,
    column: series int,
    row: series int,
    bg_color: series Color
  )

Sets the background color of a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
bg_colorseries ColorThe new background color for the cell.

cell_set_height ​

navi
cell_set_height(
    table_id: series Table,
    column: series int,
    row: series int,
    height: series float
  )

Sets the height of a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
heightseries floatThe new height of the cell in pixels.

cell_set_text ​

navi
cell_set_text(
    table_id: series Table,
    column: series int,
    row: series int,
    text: series String
  )

Sets the text of a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
textseries StringThe new text content for the cell.

cell_set_text_color ​

navi
cell_set_text_color(
    table_id: series Table,
    column: series int,
    row: series int,
    text_color: series Color
  )

Sets the text color of a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_colorseries ColorThe new text color for the cell.

cell_set_text_font_family ​

Sets the font family of the text in a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_font_familyseries FontFamilyThe font family: FontFamily.Default or FontFamily.Monospace.

Sets the font family of a table cell, by name.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_font_familyseries StringThe font family: "default" or "monospace". Kept so a script that spells the value out keeps working; new code should pass FontFamily.

cell_set_text_formatting ​

navi
cell_set_text_formatting(
    table_id: series Table,
    column: series int,
    row: series int,
    text_formatting: const TextFormat
  )

Sets the text formatting of the text in a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_formattingconst TextFormatThe text formatting options.

cell_set_text_halign ​

Sets the horizontal alignment of the text in a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_halignseries TextHAlignThe horizontal text alignment: TextHAlign.Left, TextHAlign.Center, or TextHAlign.Right.

Sets the horizontal alignment of a table cell, by name.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_halignseries StringThe horizontal text alignment: "left", "center" or "right". Kept so a script that spells the value out keeps working; new code should pass TextHAlign.

cell_set_text_size ​

Sets the text size of a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_sizeseries intThe new text size in pixels.

Sets the text size of a specific cell in a table.

Overload with named size constant.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_sizeseries SizeThe new text size as a named constant (size.tiny, size.small, size.normal, size.large, size.huge).

cell_set_text_valign ​

Sets the vertical alignment of the text in a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_valignseries TextVAlignThe vertical text alignment: TextVAlign.Top, TextVAlign.Center, or TextVAlign.Bottom.

Sets the vertical alignment of a table cell, by name.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
text_valignseries StringThe vertical text alignment: "top", "center" or "bottom". Kept so a script that spells the value out keeps working; new code should pass TextVAlign.

cell_set_tooltip ​

navi
cell_set_tooltip(
    table_id: series Table,
    column: series int,
    row: series int,
    tooltip: series String
  )

Sets the tooltip of a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
tooltipseries StringThe new tooltip text for the cell.

cell_set_width ​

navi
cell_set_width(
    table_id: series Table,
    column: series int,
    row: series int,
    width: series float
  )

Sets the width of a specific cell in a table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
columnseries intThe column index of the cell (0-based).
rowseries intThe row index of the cell (0-based).
widthseries floatThe new width of the cell in pixels.

clear ​

navi
clear(
    table_id: series Table,
    start_column: series int = 0,
    start_row: series int = 0,
    end_column: series int = na,
    end_row: series int = na
  )

Clears the contents of the specified range of cells in the table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table to modify.
start_columnseries int0The starting column index.
start_rowseries int0The starting row index.
end_columnseries intnaThe ending column index. When na, denotes last column.
end_rowseries intnaThe ending row index. When na, denotes last row.

delete ​

navi
delete(table_id: series Table)

Deletes the table from the chart.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table to delete.

merge_cells ​

navi
merge_cells(
    table_id: series Table,
    start_column: series int = 0,
    start_row: series int = 0,
    end_column: series int = na,
    end_row: series int = na
  )

Merges the specified range of cells in the table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table to modify.
start_columnseries int0The starting column index.
start_rowseries int0The starting row index.
end_columnseries intnaThe ending column index. When na, denotes last column.
end_rowseries intnaThe ending row index. When na, denotes last row.

set_bg_color ​

navi
set_bg_color(table_id: series Table, bg_color: series Color)

Sets the background color of the table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
bg_colorseries ColorThe new background color of the table.

set_border_color ​

navi
set_border_color(table_id: series Table, border_color: series Color)

Sets the border color of the table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
border_colorseries ColorThe new border color of the table.

set_border_width ​

navi
set_border_width(table_id: series Table, border_width: series int)

Sets the border width of the table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
border_widthseries intThe new border width in pixels.

set_frame_color ​

navi
set_frame_color(table_id: series Table, frame_color: series Color)

Sets the frame color of the table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
frame_colorseries ColorThe new frame border color of the table.

set_frame_width ​

navi
set_frame_width(table_id: series Table, frame_width: series int)

Sets the frame width of the table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
frame_widthseries intThe new frame border width in pixels.

set_position ​

navi
set_position(table_id: series Table, position: series Position)

Sets the position of the table.

Parameters

NameTypeDefaultDescription
table_idseries TableThe table object to modify.
positionseries PositionThe new position of the table on the chart.