Sets a cell's width as a percent of the chart width; 0 lets the text decide.
A value of 10 makes the cell a tenth of the chart's width. 0 returns the cell to automatic width, sized to its text.
Cells in one column share a width, so the setting on one cell shapes the whole column. A merged cell spans the widths of the columns it covers.
Syntax
table.cell_set_width(table_id: series table, column: series int, row: series int, width: series int/float (optional)) -> void
table.cell_set_width(column: series int, row: series int, width: series int/float (optional)) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| table_id | series table | required | The table that holds the cell whose width is set. |
| column | series int | required | Column of the cell whose width is set, counting from 0 at the left. |
| row | series int | required | Row of the cell whose width is set, counting from 0 at the top. |
| width | series int/ | 0 | Width as a percent of the chart width, for example 10. 0, the default, fits the text. |
Returns
Nothing.
Example
//@version=6
indicator("table.cell_set_width: value column", overlay = true)
w = input.float(10, "Value column width, % of chart", minval = 1, maxval = 40)
var t = table.new(position.top_left, 2, 1)
if barstate.islast
table.cell(t, 0, 0, "Volume")
table.cell(t, 1, 0, str.tostring(volume, format.volume))
table.cell_set_width(t, 1, 0, w)See also
Runs on Sidechair