[IPython-dev] Applying CSS per notebook / per cell

Rinaldo Betkiewicz rinaldo at bccn-berlin.de
Fri Jun 13 10:39:59 EDT 2014


dear all,

what would be the recommended way to apply CSS locally, i.e. in a
notebook or a single cell? The documentation states that
CSS/javascript in markdown cells has been disabled in IPython 2,
however HTML output (containing CSS/javascript) will be interpreted in
trusted notebooks. For example, after some searching, I found a way
the change the width of the cells in a notebook by executing:

In [ ]:
from IPython.core.display import HTML
style = """
<style>
.container { width:100% !important; }
</style>
"""
HTML(style)


Is there a more explicit way to do that? Is it possible there a way to
change the style of a single cell (e.g. changing cell size) ?

Cheers,

Rinaldo



More information about the IPython-dev mailing list