Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand DataFrame Table Width #1017

Closed
seanlaw opened this issue Oct 13, 2022 · 5 comments · Fixed by #1018
Closed

Expand DataFrame Table Width #1017

seanlaw opened this issue Oct 13, 2022 · 5 comments · Fixed by #1018

Comments

@seanlaw
Copy link

seanlaw commented Oct 13, 2022

Thank you for providing this wonderful theme! While using it, I noticed that some of my Pandas DataFrames appear to be squished horizontally (i.e., the columns aren't being expanded):

Screen Shot 2022-10-13 at 10 13 38 AM

The live example can be found here.

Is there a setting that I am missing that can help ensure that the DataFrames appear normally?

@12rambau
Copy link
Collaborator

What extension are you using to display notebooks in your documentation?

@seanlaw
Copy link
Author

seanlaw commented Oct 13, 2022

In my conf.py, I am seeing:

extensions = [
    "sphinx.ext.napoleon",
    "sphinx.ext.autodoc",
    "sphinx.ext.autosummary",
    "sphinx.ext.intersphinx",
    "sphinx.ext.mathjax",
    "sphinx.ext.viewcode",
    "nbsphinx",
    "numpydoc",
]

I think nbsphinx is for notebooks

@12rambau
Copy link
Collaborator

I've looked at your documentation and it seems that nbsphinx is a very bad neighbor as it's not injecting its CSS in the <header> but in the <article> which prevents the fix I created here #954 to work.

Could you try to add to your custom css:

html div.rendered_html table {
display-table: auto;
}

Other solution is to change the notebook rendering lib and use the one we use for this theme: myst_nbw

@seanlaw
Copy link
Author

seanlaw commented Oct 14, 2022

With your guidance above, I ended up adding:

html div.rendered_html table {
    table-layout: auto;
}

And that seemed to do the trick

@12rambau
Copy link
Collaborator

I'll try to add it in our css so that it works for everyone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants