Skip to content

Commit 7776543

Browse files
authored
FIX: improve display of table in the nbsphinx context (#954)
* force table-layout for nbsphinx outputs * widden the pandas example * import string
1 parent 959042d commit 7776543

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

docs/examples/pydata.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ Below are examples of each that we use as a benchmark for reference.
2121
## Pandas
2222

2323
```{code-cell}
24+
import string
25+
2426
import numpy as np
2527
import pandas as pd
2628
2729
rng = np.random.default_rng()
28-
data = rng.standard_normal((100, 3))
29-
df = pd.DataFrame(data, columns=['a', 'b', 'c'])
30+
data = rng.standard_normal((100, 26))
31+
df = pd.DataFrame(data, columns=list(string.ascii_lowercase))
3032
df
3133
```
3234

src/pydata_sphinx_theme/assets/styles/extensions/_pydata.scss

+9
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@
66
.xr-wrap[hidden] {
77
display: block !important;
88
}
9+
10+
/**
11+
* special case for table rendered via nbsphinx
12+
*/
13+
.rendered_html {
14+
table {
15+
table-layout: auto;
16+
}
17+
}

0 commit comments

Comments
 (0)