Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bokeh DataTable width

Tags:

python

bokeh

Seems bokeh DataTable has a fixed whole table width?

When I set width of columns to be large, it will not work. The code below has 4 columns width = 1000, but it will only show 4 columns of much smaller width.

Also, although I can move the boundaries of each column in the output html in Chrome, I can't move the right end of the table in html -- The whole table width seems to be fixed.

Is there a way to have tables of large width?

import bokeh.models.widgets as bmw

source = bokeh.models.ColumnDataSource(df)
numformatter = bmw.NumberFormatter()
numformatter.format = '0.00'
columns = [TableColumn(field=c, title=c, width = 1000, formatter=numformatter) for c in df]

table = bmw.DataTable(source=source, columns=columns, height = 1000)
like image 360
jf328 Avatar asked Dec 31 '25 23:12

jf328


1 Answers

Just found out that DataTable has an attribute width (which is not documented). So

table = bmw.DataTable(source=source, columns=columns, height = 1000, width = 4000)

will work

like image 173
jf328 Avatar answered Jan 02 '26 15:01

jf328