Skip to content

Commit a526158

Browse files
committed
Allow html in columns
1 parent 500d36c commit a526158

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

docs/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
ITables ChangeLog
22
=================
33

4+
1.6.3 (2023-12-10)
5+
------------------
6+
7+
**Changed**
8+
- HTML in table columns is supported ([#213](https://github.com/mwouts/itables/issues/213))
9+
10+
411
1.6.2 (2023-10-07)
512
------------------
613

itables/javascript.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _table_header(
144144
# Generate table head using pandas.to_html(), see issue 63
145145
pattern = re.compile(r".*<thead>(.*)</thead>", flags=re.MULTILINE | re.DOTALL)
146146
try:
147-
html_header = df.head(0).to_html()
147+
html_header = df.head(0).to_html(escape=False)
148148
except AttributeError:
149149
# Polars DataFrames
150150
html_header = pd.DataFrame(data=[], columns=df.columns).to_html()

itables/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""ITables' version number"""
22

3-
__version__ = "1.6.2"
3+
__version__ = "1.6.3"

tests/test_html_in_table_header.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import pandas as pd
2+
3+
from itables import to_html_datatable
4+
5+
6+
def test_html_in_table_header(df=pd.DataFrame({"<b>B</b>": [1]})):
7+
html = to_html_datatable(df)
8+
print(html)
9+
assert "<b>B</b>" in html

0 commit comments

Comments
 (0)