有没有一种格式化窗口小部件内容的方法? [英] Is there a way to format the widgets' contents?

查看:61
本文介绍了有没有一种格式化窗口小部件内容的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想在RadioButtonGroup的一个选项中加一个下划线,这有可能吗?

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

我试图使用Div类作为输入,但是没有用.

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

谢谢

推荐答案

此PR >添加支持用于在所有LayoutDOM上指定CSS类的将于2017年12月进入Bokeh 0.12.4,并提供了一种向任意Bokeh LayoutDOM模型(例如小部件)添加任意CSS类的机制.风格.

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.

它将可用:

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

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

然后,您可以在模板等中添加.my-custom的样式.

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

这篇关于有没有一种格式化窗口小部件内容的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆