Skip to content

DataFrame with long column labels is not rendered correctly with the pydata theme #761

@LuoXueling

Description

@LuoXueling

Hi. I am new to nbsphinx and sphinx.

I have a problem if the cell output is a DataFrame with long column labels when using html_theme = "pydata_sphinx_theme", as shown below, column labels collide with each other. But everything looks fine when using sphinx_rtd_theme.

image

Here is a minimal example:

  1. Build the default sphinx project with sphinx-quickstart.

  2. In conf.py:

extensions = [
    "nbsphinx",
]

html_theme = "pydata_sphinx_theme"
  1. In the notebook:
import pandas as pd

df = pd.DataFrame({f"ABCDEFGHIJKLMNOPQRSTUVWXYZ_{i}": 0.123456789 for i in range(10)}, index=[0])
df

I am using sphinx==6.2.1, nbsphinx==0.9.2, and pydata_sphinx_theme==0.13.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions