Formatting index column in DataTable

Hello everyone,

I currently have a project, where I would like to color the index column of a table. Is that possible? Also, I would like to update it with a JS callback.

I suspect not after playing around with this example.

Many thanks,

EDIT: Moved it from development to community support.

This probably belongs to the #community-support - #development is for the development of Bokeh itself.

As for you question - how did you come up with the conclusion that it’s not possible given that example? After all, that example shows that you can definitely apply color to cells.

Fixed that.

First, it is more of a guess than a conclusion. I tried playing around with it and put values in the index column. When I searched for it in the forum, I only found very old threads where the sense of the index column was questioned. So I thought it might be beneficial for the community to have some discussion on it here.

Ah, I think I misunderstood initially. Only in the morning did I realize that you were talking about the # column and not the index column automatically created by data sources from Pandas data frames.

It’s definitely possible to assign a static color to it using CSS. It should even be possible to assign different colors to different rows with the :nth-child selector.
But you’re correct - it’s not possible to manipulate it with Bokeh itself. What you can do is disable the automatic index column and create it manually, with any parameters that you want it to have.