☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

DataTable HTMLTemplateFormatter cell size

Community Support
efremdan1
efremdan1

Currently, one can set the background color and other CSS style elements of DataTable cells using the HTMLTemplateFormatter. However, this assigns a child <div class> to the parent <div class slick-cell> which has padding set to 4 px and border set to 0.25 px. Thus, there’s always going to be a bit of white background behind the color, as seen in the answer to rbokeh - How to color rows and/or cells in a Bokeh DataTable? - Stack Overflow.

It would be nice to be able to color an entire row without that white margin showing up. With the parent having that padding, I don’t think this is possible. One could set the width of the child to something like 110% in the HTMLTemplateFormatter, but this would only push the background color in one direction.

I think it would be better for the parent’s padding and border to be set to 0 px, and then the child (which the user gets control over with HTMLTemplateFormatter) gets to be anywhere the user wants it. So I’d like to change bokeh/tables.less at b56543346bad8cdabe99960e63133619feaafbb7 · bokeh/bokeh · GitHub lines 49, 50, and 52 to 0 px.

Is this the kind of thing I need to make a custom model for, or should I put in a pull request?

⌁   Link to post
efremdan1
efremdan1

I’ll put in an issue for it. I don’t want to put in a pull request with my suggested answer because it does make the default look not look as good, so I think that’s something the core developers will need to think through.

⌁   Link to post

End of archived discussion · Replies are disabled