Search code examples
pythonipywidgets

Monospace in ipywidgets.Textarea?


how could I get my widgets to use monospace fonts?

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

I want to show some table style data.


Solution

  • This also works:

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