Sidechair

table.cell_set_text_formatting()

Browse the reference

Sets bold, italic, both or neither on the text of one cell.

Try it in the editor

Pass text.format_bold, text.format_italic or text.format_none. Add the first two with + to get bold italic text; none switches both off again.

Bold fits header cells and totals. Only the text of the named cell changes.

Syntax

Pine Script
table.cell_set_text_formatting(table_id: series table, column: series int, row: series int, text_formatting: series text_format) -> void
table.cell_set_text_formatting(column: series int, row: series int, text_formatting: series text_format) -> void

Arguments

NameTypeDefaultDescription
table_idseries tablerequiredThe table that holds the cell whose text style changes.
columnseries intrequiredColumn of the cell whose text style changes, counting from 0 at the left.
rowseries intrequiredRow of the cell whose text style changes, counting from 0 at the top.
text_formattingseries text_formatrequiredtext.format_none, text.format_bold or text.format_italic. Add bold and italic with + for both.

Returns

Nothing.

Example

Pine ScriptA bold italic headerOpen in editor
//@version=6
indicator("table.cell_set_text_formatting: bold italic", overlay = true)
var t = table.new(position.top_right, 1, 2)
if barstate.islast
    table.cell(t, 0, 0, "Totals")
    table.cell(t, 0, 1, str.tostring(volume, format.volume))
    table.cell_set_text_formatting(t, 0, 0, text.format_bold + text.format_italic)

See also

Runs on Sidechair