Skip to content
Algo Trade Analytics Docs

table.new() - Pine Script Function

The function creates a new table.

table.new(position, columns, rows, bgcolor, frame_color, frame_width, border_color, border_width, force_overlay) → series table
NameTypeDescription
positionseries stringPosition of the table. Possible values are: position.top_left
position.top_center
position.top_right
position.middle_left
position.middle_center
position.middle_right
position.bottom_left
position.bottom_center
position.bottom_right.

The ID of a table object that can be passed to other table.*() functions.

  • This function creates the table object itself, but the table will not be displayed until its cells are populated. To define a cell and change its contents or attributes, use table.cell and other table.cell_*() functions.
//@version=6
indicator("table.new example")
var testTable = table.new(position = position.top_right, columns = 2, rows = 1, bgcolor = color.yellow, border_width = 1)
if barstate.islast
table.cell(table_id = testTable, column = 0, row = 0, text = "Open is " + str.tostring(open))
table.cell(table_id = testTable, column = 1, row = 0, text = "Close is " + str.tostring(close), bgcolor=color.teal)