Search code examples
jupyter-notebookipywidgets

How to get wider text for Checkbox widget?


How can I configure the ipywidgets Checkbox for long text strings as in,

 c = Checkbox(description=' this is some very long very long text',value=False)

and not get the text to be squeezed and wrapped in the encompassing Jupyter notebook?

Thanks!


Solution

  • Put this is the cell with the checkbox

    from IPython.display import display, HTML
    HTML('<style> .widget-hbox .widget-label { max-width:350ex; text-align:left} </style>')
    

    and it'll change the widths and alignment.