Tabulator: Access to the columns dict in configuration to customise the headers

Hi All,

I am fairly new to Panel and it is an awesome package.

Right now I am trying to figure out to use the column configuration dict from Tabulator.
From the documentation, it says:

These and other available tabulator options are listed at Tabulator | JavaScript Tables & Data Grids.
Obviously not all options will work though, especially any settable callbacks and options which are set by the internal panel tabulator module (for example the columns option).

What I am trying to achieve is to customise the header column name using a latex/katex expression.

For example, using the following does not work:

df = pd.DataFrame({
    'sig': [1, 2, 3],
    'x': [3.14, 6.28, 9.42],
}, index=[1, 2, 3])

df_widget = pn.widgets.Tabulator(df, titles={
    'sig': '$\sigma_{A}$'
})

With having access to the properties titleFormatter and titleFormatterParams it would be possible to define a custom formatter to display the Latex expression via Katex for example.

Is there any to achieve such behaviour with the current implementation of Tabulator in Panel?
Also having access to the columns dict would allow to control the column order and validate the input value. Right now there is no way to restrict a number to a minimum value when entering the value by hand for example.

Thanks.

2 Likes