From 49baa0d53eac50c5169c12275296770f1e1b9732 Mon Sep 17 00:00:00 2001 From: Leonard Gerard Date: Tue, 9 Jul 2024 22:45:50 -0700 Subject: [PATCH] Wrap tabs as needed --- ipyplot/_html_helpers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ipyplot/_html_helpers.py b/ipyplot/_html_helpers.py index b5cee2e..a518c03 100644 --- a/ipyplot/_html_helpers.py +++ b/ipyplot/_html_helpers.py @@ -99,10 +99,12 @@ def _create_tabs( border-radius: 4px 4px 0 0; position: relative; top: 1px; + display: inline-flex; } input.ipyplot-tab-%(0)s:checked + label.ipyplot-tab-label-%(0)s { background: #FFF; border-bottom: 1px solid transparent; + display: inline-flex; } input.ipyplot-tab-%(0)s ~ .tab { border-top: 1px solid #999; @@ -222,7 +224,7 @@ def _create_html_viewer( return html_viewer -def _display_html(html: str): +def _display_html(html: str, debug_html: bool = False): """Simply displays provided HTML string using IPython.display function. Parameters @@ -235,7 +237,8 @@ def _display_html(html: str): handle: DisplayHandle Returns a handle on updatable displays """ - display(HTML(_create_html_viewer(html))) + if debug_html: + display(HTML(_create_html_viewer(html))) return display(HTML(html))