Skip to content

Commit

Permalink
fix: improve style for nbsphinx tables
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Feb 28, 2024
1 parent 202f96e commit ca8715d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/extensions/nbsphinx.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,27 @@
"YouTubeVideo('9_OIs49m56E')"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"Tables\n",
"~~~~~~\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"data = [[1, 2], [3, 4]]\n",
"pd.DataFrame(data, columns=['Foo', 'Bar'])"
]
},
{
"cell_type": "raw",
"metadata": {
Expand Down
17 changes: 17 additions & 0 deletions static/css/extensions/nbsphinx.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,20 @@
.yue div.nboutput.container div.output_area > .math-wrapper > div.math {
padding-top: 0;
}

.yue .jp-RenderedHTMLCommon thead,
.yue div.rendered_html thead {
border-color: var(--sy-c-border);
}
.yue .jp-RenderedHTMLCommon tbody tr,
.yue div.rendered_html tbody tr {
color: var(--sy-c-text);
}
.yue .jp-RenderedHTMLCommon tbody tr:nth-child(odd),
.yue div.rendered_html tbody tr:nth-child(odd) {
background-color: var(--sy-c-surface);
}
.yue .jp-RenderedHTMLCommon tbody tr:hover,
.yue div.rendered_html tbody tr:hover {
background-color: var(--color-surface-accent);
}

0 comments on commit ca8715d

Please sign in to comment.