데이터 분석/Python, R 문법
[Python] 주피터 노트북 셀 여백 조정
장찐
2021. 11. 12. 09:39
◈ JupyterNotebook 셀 좌우 여백 조정
주피터 노트북을 사용하다 보면 좌우 여백의 간격이 너무 넓어서 사용이 불편할 때가 있다. 주피터 노트북 자체가 웹 기반 IDE라서 HTML을 이용해서 간단하게 여백 조정이 가능하다
• 코드 적용 전 화면
![](https://blog.kakaocdn.net/dn/thJ4s/btrkEwktW5G/zPoejyk0wGUoBO1UdG3ud0/img.png)
• 입력 코드
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>"))
display(HTML("<style>.output_result { max-width:95% !important; }</style>"))
#여백 줄이기
display(HTML("<style>.prompt { min-width: 1ex !important; }</style>"))
#In 부분 없애기
#display(HTML("<style>.prompt bdi { display:none !important; }</style>"))
#아예 다 없애기
#display(HTML("<style>.prompt { display:none !important; }</style>"))
• 코드 적용 후 화면