Formatting DataTable Header row

Hello

I am using Bokeh version 2.2.3 and python 3.6.12.
In my dashboard, I am using a DataTable. The source for the DataTable is a type Column Data Source.

The table column formatter attribute lets me format the column values (using string formatter).
I am trying to also format the header row of the DataTable so that the headers are centered and are Bold.

What is the best way to achieve this? Is there anyway to use StringFormatter to do the same?

The data table header appearance is not currently configurable via any API. If you are embedding the Bokeh content in a template or page of your own, then you could target the underlying SlickGrid DOM elements using CSS. Feel free to open a GitHub issue to discuss it as a new feature.

2 Likes

As Inspiration you can check out how I’ve styled the bokeh datatable using css at https://awesome-panel.org/panel-component-explorer.

The css styling is here https://github.com/MarcSkovMadsen/awesome-panel-extensions/blob/master/awesome_panel_extensions/frameworks/fast/assets/css/fast_bokeh_slickgrid.css

1 Like