How to color rows and/or cells in a Bokeh DataTable?

后端 未结 2 689
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 07:01

Starting from Initial table, I need to highlight(color) elements as shown in either one of the table examples Ex. 1, Ex. 2, Ex. 3.

<
2条回答
  •  渐次进展
    2020-12-09 07:43

    I don't know how to do example 1 and 3. But you can do example 2.

    Here it is with custom css in a folder app:

    myapp/templates/styles.css:

    .bk-root .slick-cell.selected {
        background: lightblue;
        color:red;
    }
    

    And the html template:

    /myapp/templates/index.html:

    
    
      
        
        {{ bokeh_css }}
        {{ bokeh_js }}
      
      
        
        {{ plot_div|indent(8) }}
        {{ plot_script|indent(8) }}
      
    
    

    And in myapp/main.py just have your code that makes the table

提交回复
热议问题