bokeh数据表宽度

2024-10-01 09:40:44 发布

您现在位置:Python中文网/ 问答频道 /正文

bokeh DataTable似乎有固定的整个表宽度?在

当我将列的宽度设置为大时,它将不起作用。下面的代码有4列width=1000,但它只显示4列宽度小得多的列。在

另外,虽然我可以在Chrome中移动输出html中每个列的边界,但在html中我不能移动表的右端——整个表的宽度似乎是固定的。在

有没有办法有大宽度的桌子?在

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)

Tags: columns代码sourcedf宽度modelshtmlbokeh
1条回答
网友
1楼 · 发布于 2024-10-01 09:40:44

刚刚发现DataTable有一个属性width(没有文档记录)。所以

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

会有用的

相关问题 更多 >