Skip to content

Commit 765c25c

Browse files
grstflying-sheep
andauthored
Reduce font size in data frames (#250)
Co-authored-by: Philipp A <flying-sheep@web.de>
1 parent b477da6 commit 765c25c

4 files changed

Lines changed: 75 additions & 1 deletion

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Reduce the font size in data frames - See https://github.com/scverse/cookiecutter-scverse/issues/193 */
2+
div.cell_output table.dataframe {
3+
font-size: 0.8em;
4+
}

{{cookiecutter.project_name}}/docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
#
110110
html_theme = "sphinx_book_theme"
111111
html_static_path = ["_static"]
112+
html_css_files = ["css/custom.css"]
113+
112114
html_title = project_name
113115

114116
html_theme_options = {

{{cookiecutter.project_name}}/docs/notebooks/example.ipynb

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"source": [
1616
"import numpy as np\n",
1717
"from anndata import AnnData\n",
18+
"import pandas as pd\n",
1819
"import {{cookiecutter.package_name}}"
1920
]
2021
},
@@ -73,6 +74,72 @@
7374
"source": [
7475
"{{cookiecutter.package_name}}.pp.basic_preproc(adata)"
7576
]
77+
},
78+
{
79+
"cell_type": "code",
80+
"execution_count": 4,
81+
"metadata": {},
82+
"outputs": [
83+
{
84+
"data": {
85+
"text/html": [
86+
"<div>\n",
87+
"<style scoped>\n",
88+
" .dataframe tbody tr th:only-of-type {\n",
89+
" vertical-align: middle;\n",
90+
" }\n",
91+
"\n",
92+
" .dataframe tbody tr th {\n",
93+
" vertical-align: top;\n",
94+
" }\n",
95+
"\n",
96+
" .dataframe thead th {\n",
97+
" text-align: right;\n",
98+
" }\n",
99+
"</style>\n",
100+
"<table border=\"1\" class=\"dataframe\">\n",
101+
" <thead>\n",
102+
" <tr style=\"text-align: right;\">\n",
103+
" <th></th>\n",
104+
" <th>A</th>\n",
105+
" <th>B</th>\n",
106+
" </tr>\n",
107+
" </thead>\n",
108+
" <tbody>\n",
109+
" <tr>\n",
110+
" <th>0</th>\n",
111+
" <td>a</td>\n",
112+
" <td>1</td>\n",
113+
" </tr>\n",
114+
" <tr>\n",
115+
" <th>1</th>\n",
116+
" <td>b</td>\n",
117+
" <td>2</td>\n",
118+
" </tr>\n",
119+
" <tr>\n",
120+
" <th>2</th>\n",
121+
" <td>c</td>\n",
122+
" <td>3</td>\n",
123+
" </tr>\n",
124+
" </tbody>\n",
125+
"</table>\n",
126+
"</div>"
127+
],
128+
"text/plain": [
129+
" A B\n",
130+
"0 a 1\n",
131+
"1 b 2\n",
132+
"2 c 3"
133+
]
134+
},
135+
"execution_count": 4,
136+
"metadata": {},
137+
"output_type": "execute_result"
138+
}
139+
],
140+
"source": [
141+
"pd.DataFrame().assign(A=[\"a\", \"b\", \"c\"], B=[1, 2, 3])"
142+
]
76143
}
77144
],
78145
"metadata": {
@@ -91,7 +158,7 @@
91158
"name": "python",
92159
"nbconvert_exporter": "python",
93160
"pygments_lexer": "ipython3",
94-
"version": "3.9.12"
161+
"version": "3.11.3"
95162
},
96163
"vscode": {
97164
"interpreter": {

{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ doc = [
4141
"ipykernel",
4242
"ipython",
4343
"sphinx-copybutton",
44+
"pandas",
4445
]
4546
test = [
4647
"pytest",

0 commit comments

Comments
 (0)