Is there a way to format the widgets' contents?

情到浓时终转凉″ 提交于 2019-12-18 09:15:11

问题


Let's say I'd like to underline a word in one of my options in a RadioButtonGroup, is it possible?

I tried to use the Div class as an input, but it didn't work.

Thanks


回答1:


This PR "Add support for specifying CSS classes on all LayoutDOM" will be going into Bokeh 0.12.4 in Dec 2017 and provided a mechanism to add arbitrary CSS classes to any Bokeh LayoutDOM model (e.g. widgets) so that they can be more easily styled.

It will be available like:

from bokeh.models import Div
div = Div(text="some text")

# add these CSS classes to the widget div 
div.css_classes = ["my-custom"]

Then you can add styles for .my-custom in your template or whatever.



来源:https://stackoverflow.com/questions/40981485/is-there-a-way-to-format-the-widgets-contents

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!