Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN: Followup to HTML Formatting #11634

Merged
merged 1 commit into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ lxml
sqlalchemy
bottleneck
pymysql
Jinja2
3 changes: 3 additions & 0 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,14 @@ def clean():

def html():
check_build()
os.system('jupyter nbconvert --to=html --template=basic '
'--output=source/html-styling.html source/html-styling.ipynb')
if os.system('sphinx-build -P -b html -d build/doctrees '
'source build/html'):
raise SystemExit("Building HTML failed.")
try:
# remove stale file
os.system('rm source/html-styling.html')
os.system('cd build; rm -f html/pandas.zip;')
except:
pass
Expand Down
6,243 changes: 2,981 additions & 3,262 deletions doc/source/html-styling.html

Large diffs are not rendered by default.

5,985 changes: 2,999 additions & 2,986 deletions doc/source/html-styling.ipynb

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions doc/source/themes/nature_with_gtoc/static/nature.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,19 @@ td.field-body blockquote {
padding-left: 30px;
}

.rendered_html table {
margin-left: auto;
margin-right: auto;
border-right: 1px solid #cbcbcb;
border-bottom: 1px solid #cbcbcb;
}

.rendered_html td, th {
border-left: 1px solid #cbcbcb;
border-top: 1px solid #cbcbcb;
margin: 0;
padding: 0.5em .75em;
}

/**
* See also
Expand Down
16 changes: 15 additions & 1 deletion doc/source/whatsnew/v0.17.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,25 @@ New features
Conditional HTML Formatting
^^^^^^^^^^^^^^^^^^^^^^^^^^^

We've added *experimental* support for conditional HTML formatting,
We've added *experimental* support for conditional HTML formatting:
the visual styling of a DataFrame based on the data.
The styling is accomplished with HTML and CSS.
Acesses the styler class with :attr:`pandas.DataFrame.style`, attribute,
an instance of :class:`~pandas.core.style.Styler` with your data attached.

Here's a quick example:

.. ipython:: python

np.random.seed(123)
df = DataFrame(np.random.randn(10, 5), columns=list('abcde'))
html = df.style.background_gradient(cmap='viridis', low=.5)

We can render the HTML to get the following table.

.. raw:: html
:file: whatsnew_0171_html_table.html

See the :ref:`example notebook <style>` for more.

.. _whatsnew_0171.enhancements:
Expand Down
Loading