oort77

Set cell height in Colab

Aug 24th, 2021 (edited)
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. from IPython.core.magic import register_line_magic
  2. from IPython.display import Javascript
  3.  
  4. @register_line_magic
  5. def set_cell_height(size=300):
  6.   display(
  7.       Javascript("google.colab.output.setIframeHeight(0, true, {maxHeight: " +
  8.                  str(size) + "})"))
  9.  
  10. # ==== In cell ====
  11. %set_cell_height 300
Add Comment
Please, Sign In to add comment