Skip to content

table

Properties

all

Type: series array<table>

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

Functions

new

pine
table.new(
    series string position,
    series int columns,
    series int rows,
    series color bgcolor = na,
    series color frame_color = na,
    series int frame_width = 0,
    series color border_color = na,
    series int border_width = 0,
    series bool force_overlay = false
  ) → series table

Creates a table object on the chart.

Parameters

NameTypeDefaultDescription
positionseries stringThe 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.
bgcolorseries 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

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 string""The 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 stringtext.align_centerThe horizontal text alignment.
text_valignseries stringtext.align_centerThe vertical text alignment.
text_sizeseries int14The text size in pixels.
bgcolorseries colornaThe background color of the cell.
tooltipseries stringnaThe tooltip text for the cell.
text_font_familyseries stringfont.family_defaultThe font family for the text.
text_formattingconst text_formattext.format_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 string""The 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 stringtext.align_centerThe horizontal text alignment.
text_valignseries stringtext.align_centerThe vertical text alignment.
text_sizeseries stringsize.autoThe text size as a named constant.
bgcolorseries colornaThe background color of the cell.
tooltipseries stringnaThe tooltip text for the cell.
text_font_familyseries stringfont.family_defaultThe font family for the text.
text_formattingconst text_formattext.format_noneThe text formatting options.

cell_set_bgcolor

pine
table.cell_set_bgcolor(
    series table table_id,
    series int column,
    series int row,
    series color bgcolor
  )

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).
bgcolorseries colorThe new background color for the cell.

cell_set_height

pine
table.cell_set_height(
    series table table_id,
    series int column,
    series int row,
    series float height
  )

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

pine
table.cell_set_text(
    series table table_id,
    series int column,
    series int row,
    series string text
  )

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

pine
table.cell_set_text_color(
    series table table_id,
    series int column,
    series int row,
    series color text_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

pine
table.cell_set_text_font_family(
    series table table_id,
    series int column,
    series int row,
    series string 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 stringThe font family: font.family_default or font.family_monospace.

cell_set_text_formatting

pine
table.cell_set_text_formatting(
    series table table_id,
    series int column,
    series int row,
    const text_format text_formatting
  )

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 text_formatThe text formatting options.

cell_set_text_halign

pine
table.cell_set_text_halign(
    series table table_id,
    series int column,
    series int row,
    series string 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 stringThe horizontal text alignment: text.align_left, text.align_center, or text.align_right.

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 stringThe new text size as a named constant (size.tiny, size.small, size.normal, size.large, size.huge).

cell_set_text_valign

pine
table.cell_set_text_valign(
    series table table_id,
    series int column,
    series int row,
    series string 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 stringThe vertical text alignment: text.align_top, text.align_center, or text.align_bottom.

cell_set_tooltip

pine
table.cell_set_tooltip(
    series table table_id,
    series int column,
    series int row,
    series string tooltip
  )

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

pine
table.cell_set_width(
    series table table_id,
    series int column,
    series int row,
    series float width
  )

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

pine
table.clear(
    series table table_id,
    series int start_column = 0,
    series int start_row = 0,
    series int end_column = na,
    series int end_row = 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

pine
table.delete(series table table_id)

Deletes the table from the chart.

Parameters

NameTypeDefaultDescription
table_idseries tableThe table to delete.

merge_cells

pine
table.merge_cells(
    series table table_id,
    series int start_column = 0,
    series int start_row = 0,
    series int end_column = na,
    series int end_row = 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_bgcolor

pine
table.set_bgcolor(series table table_id, series color bgcolor)

Sets the background color of the table.

Parameters

NameTypeDefaultDescription
table_idseries tableThe table object to modify.
bgcolorseries colorThe new background color of the table.

set_border_color

pine
table.set_border_color(series table table_id, series color border_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

pine
table.set_border_width(series table table_id, series int border_width)

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

pine
table.set_frame_color(series table table_id, series color frame_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

pine
table.set_frame_width(series table table_id, series int frame_width)

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

pine
table.set_position(series table table_id, series string position)

Sets the position of the table.

Parameters

NameTypeDefaultDescription
table_idseries tableThe table object to modify.
positionseries stringThe new position of the table on the chart.

基於 MIT 許可證發佈。