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 ast.<name>(...), for examplet.cell(0, 0, "a").
table.all (function)
Definition
Returns the array of all existing table objects (same as the table.all variable). One live table per position.
Syntax
series array<table>
An array of table IDs, oldest to newest.
Example
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
Returns
void
void
Notes
- The
sizeargument takes asize.*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_valignandtext_sizestill 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.
table.cell_set_bgcolor (function)
Definition
Sets the background color of an existing cell. No-op if the cell does not exist.
Syntax
Returns
void
void
Example
table.cell_set_height (function)
Definition
Sets the height of an existing cell as a percentage of the pane.
Syntax
Returns
void
void
Example
table.cell_set_text (function)
Definition
Sets the text of an existing cell. No-op if the cell does not exist.
Syntax
Returns
void
void
Example
table.cell_set_text_color (function)
Definition
Sets the text color of an existing cell.
Syntax
Returns
void
void
Notes
- The old name
text_colorstill compiles, with a deprecation warning that namescolor. Write the new name.
table.cell_set_text_font_family (function)
Definition
Sets the font family of an existing cell.
Syntax
Returns
void
void
Example
table.cell_set_text_formatting (function)
Definition
Sets text formatting of an existing cell (for example none, bold, italic).
Syntax
Returns
void
void
Example
table.cell_set_text_halign (function)
Definition
Sets horizontal text alignment of an existing cell: left, center, or right.
Syntax
Returns
void
void
Notes
- The old name
text_halignstill compiles, with a deprecation warning that namestexthalign. Write the new name.
table.cell_set_text_size (function)
Definition
Sets the text size of an existing cell.
Syntax
Returns
void
void
Notes
- The
sizeargument takes asize.*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_sizestill compiles, with a deprecation warning that namessize. Write the new name.
table.cell_set_text_valign (function)
Definition
Sets vertical text alignment of an existing cell: top, center, or bottom.
Syntax
Returns
void
void
Notes
- The old name
text_valignstill compiles, with a deprecation warning that namestextvalign. Write the new name.
table.cell_set_tooltip (function)
Definition
Sets the tooltip of an existing cell.
Syntax
Returns
void
void
Example
table.cell_set_width (function)
Definition
Sets the width of an existing cell as a percentage of the pane.
Syntax
Returns
void
void
Example
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
Returns
void
void
Example
table.delete (function)
Definition
Deletes a table. The position slot becomes empty.
Syntax
Returns
void
void
Example
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
Returns
void
void
Example
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
Returns
series table
The ID of the created table, or na if columns/rows are less than 1.
Example
table.set_bgcolor (function)
Definition
Sets the table background color.
Syntax
Returns
void
void
Example
table.set_border_color (function)
Definition
Sets the inner cell-border color.
Syntax
Returns
void
void
Example
table.set_border_width (function)
Definition
Sets the inner cell-border width in pixels.
Syntax
Returns
void
void
Example
table.set_frame_color (function)
Definition
Sets the outer frame color.
Syntax
Returns
void
void
Example
table.set_frame_width (function)
Definition
Sets the outer frame width in pixels.
Syntax
Returns
void
void
Example
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
Returns
void
void
Example