Skip to content
Prev Previous commit
Next Next commit
ENH: style.ipynb updates
  • Loading branch information
attack68 committed Feb 2, 2021
commit faf587e3ad3c52b594183b3916fca757c83df576
11 changes: 5 additions & 6 deletions doc/source/user_guide/style.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@
"\n",
"styles = [\n",
" hover(),\n",
" {'selector': \"th\", 'props': [(\"font-size\", \"150%\"),\n",
" (\"text-align\", \"center\")]}\n",
" {'selector': \"th\", 'props': [(\"font-size\", \"150%\"), (\"text-align\", \"center\")]}\n",
"]\n",
"\n",
"df.style.set_table_styles(styles)"
Expand Down Expand Up @@ -224,7 +223,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can also chain all of the above by setting the `overwrite` argument to `False` so that it preserves previous settings."
"We can also chain all of the above by setting the `overwrite` argument to `False` so that it preserves previous settings. We also show the CSS string input rather than the list of tuples."
]
},
{
Expand All @@ -238,13 +237,13 @@
" set_table_styles(styles).\\\n",
" set_table_styles({\n",
" 'A': [{'selector': '',\n",
" 'props': [('color', 'red')]}],\n",
" 'props': 'color:red;'}],\n",
" 'B': [{'selector': 'td',\n",
" 'props': [('color', 'blue')]}]\n",
" 'props': 'color:blue;'}]\n",
" }, axis=0, overwrite=False).\\\n",
" set_table_styles({\n",
" 3: [{'selector': 'td',\n",
" 'props': [('color', 'green')]}]\n",
" 'props': 'color:green;font-weight:bold;'}]\n",
" }, axis=1, overwrite=False)\n",
"s"
]
Expand Down