Formatting DataTable Header row


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.


As Inspiration you can check out how I’ve styled the bokeh datatable using css at

The css styling is here

1 Like