TradingView enhances Pine Tables
TradingView continues to enhance Pine Tables, which now support headers and tooltips.
It is now possible to merge several cells in a table to create fancy headers and separators. A merged cell does not have to be a header though: you can merge cells in any direction, as long as the resulting cell doesn’t affect any already merged cells, and doesn’t go outside of the table’s bounds.
To create a merged cell, use the new table.merge_cells() function. The rules are simple. You need to pass the coordinates of the first and last cell you want to merge. Everything between them will be merged into a single cell. This size of a merged cell is automatically determined by the dimensions of its neighboring rows and columns.
In the example script below, you can see three merged cells: the first one merges all cells in row zero and contains “SMA Table”, the others below it create the sub-headers.
The second improvement to tables are tooltips. Tooltips are floating text labels that appear when you hover over a table’s cell. They are handy to provide information on a cell’s content without crowding the table.
To create a cell with a tooltip, just pass a string to the new tooltip argument of the table.cell() function.
Let’s recall that TradingView introduced Pine Tables in May 2021. This functionality enables traders to present data in a way that has never been possible before.
Tables are objects that can be used to position information in specific and fixed locations in a script’s visual space. Contrary to all other plots or objects drawn in Pine, tables are not anchored to specific bars: they float in a script’s space, whether in overlay or pane mode, in studies or strategies, independently of the chart bars being viewed or the zoom factor used.
You can create an auto-generated display panel with relevant data for the current symbol and pin it to the side of your screen, or create a dynamic heatmap, or provide quick access to any information available in Pine — the possibilities are endless. The tables can be used in conjunction with all other PineScript features to further improve your existing indicators.