table.clear() - Pine Script Function
table.clear()
Section titled “table.clear()”Overview
Section titled “Overview”The function removes a cell or a sequence of cells from the table. The cells are removed in a rectangle shape where the start_column and start_row specify the top-left corner, and end_column and end_row specify the bottom-right corner.
Syntax
Section titled “Syntax”table.clear(table_id, start_column, start_row, end_column, end_row) → voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| table_id | series table | A table object. |
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("A donut", overlay=true)if barstate.islast colNum = 8, rowNum = 8 padding = "◯" donutTable =table.new(position.middle_right, colNum, rowNum)for c = 0 to colNum - 1for r = 0 to rowNum - 1table.cell(donutTable, c, r, text=padding, bgcolor=#face6e, text_color=color.new(color.black, 100)) table.clear(donutTable, 2, 2, 5, 5)