代码之家  ›  专栏  ›  技术社区  ›  Soerendip

等宽ipywidgets。文本区?

  •  0
  • Soerendip  · 技术社区  · 6 年前

    如何让我的小部件使用单空格字体?

    from ipywidgets import Textarea
    Textarea('The world is bigger than you.')
    

    我想显示一些表格样式的数据。

    1 回复  |  直到 6 年前
        1
  •  1
  •   q.t.f.    6 年前

    这似乎是一个脆弱的解决办法,但这可能是一个工作。添加一个html魔术节,提供css样式:

    %%html
    <style>
    textarea, input {
        font-family: monospace;
    }
    </style>
    
        2
  •  0
  •   Soerendip    6 年前

    from IPython.display import display
    display(HTML("<style>textarea, input { font-family: monospace; }</style>"))