【问题标题】:bokeh DataTable width散景数据表宽度
【发布时间】:2017-02-15 22:49:28
【问题描述】:

似乎散景 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)

【问题讨论】:

    标签: python bokeh


    【解决方案1】:

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

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

    会起作用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-19
      • 1970-01-01
      相关资源
      最近更新 更多