☰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: fit columns + horizontal scrollbars?

Community Support
Maxxner
Maxxner

How can I achieve the following for a DataTable?

  • Colum width is calculated based on the cell content (also considering the column name)
  • table width/viewport is still respected → horizontal scrollbars are introduced if the columns are getting too wide.

The autosize_mode argument only seems to support adjusting the viewport (via "fit_viewport") or forcing all columns inside the viewport (via "fit_columns"). In both cases no horizontal scrollbars are available.

⌁   Link to post
nmasnadi
nmasnadi

I have had a similar problem since I updated to bokeh 3 where if I use fit_viewport or fit_columns the table doesn’t render at all. There is an open github issue related to this here:

For now what I found working is to specify the width for every column and use autosize_mode='none' for the DataTable.

⌁   Link to post
nmasnadi
nmasnadi

lol I just saw that the github issue I mentioned was opened yesterday by the OP. This is the issue I meant to share:

⌁   Link to post
Maxxner
Maxxner

Unfortunately that is not the case and the document mentions that there won’t be a horizontal scrollbar. So it seems like there is a feature gap.

"fit_columns"

Compute column widths based on cell contents but ensure the table fits into the available viewport. This results in no horizontal scrollbar showing up, but data can get unreadable if there is not enough space available.

⌁   Link to post

End of archived discussion · Replies are disabled