Skip to content

Commit

Permalink
Display Pandas Style objects using sparse_index=False (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Apr 28, 2024
1 parent 03ec455 commit 51b39e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ITables ChangeLog

**Fixed**
- We have improve the compatibility with dark themes ([#255](https://github.com/mwouts/itables/issues/255))
- We now enforce non-sparse index when displaying Pandas Style objects with a multiindex ([#254](https://github.com/mwouts/itables/issues/254))


2.0.0 (2024-03-16)
Expand Down
2 changes: 2 additions & 0 deletions itables/javascript.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ def to_html_datatable_using_to_html(
classes=classes, style=style
),
caption=caption,
sparse_index=False,
)
html_table = df.to_html(**to_html_args)
except TypeError:
Expand All @@ -584,6 +585,7 @@ def to_html_datatable_using_to_html(
"caption is not supported by Styler.to_html in your version of Pandas"
)
del to_html_args["caption"]
del to_html_args["sparse_index"]
html_table = df.to_html(**to_html_args)
tableId = "T_" + tableId
else:
Expand Down

0 comments on commit 51b39e9

Please sign in to comment.