-
Notifications
You must be signed in to change notification settings - Fork 349
Description
Somehow related to #1017
I have an object with multiple dataframes, so the method _ipython_display_
constructs a tab widget and each tab gets its dataframe. It all works nicely in jupyter, but fails to have proper styling when rendered with nbsphinx + pydata sphinx
See how it's rendered in jupyter, and how it's rendered in html :
As you can see, I juxtaposed regular dataframes and dataframes contained in a ipywidget tab to show that regular tabs have the right css, while dataframes inside the tab apparently suffer from the same problem as discussed in #1017
See a simplified version of the code to display the multi dataframe object:
tab = widgets.Tab()
# create output widgets
widget_images = widgets.Output()
widget_annotations = widgets.Output()
# render in output widgets
with widget_images:
display(self.images)
with widget_annotations:
display(self.annotations)
tab.children = [widget_images, widget_annotations]
tab.titles = ["Images", "Annotations"]
display(tab)
Note that I considered moving to Myst-NB, but I still have some other problems with widgets rendering (see executablebooks/MyST-NB#458)