diff --git a/docs/changelog.md b/docs/changelog.md index fc2a0d18..1c9d55a8 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -5,6 +5,7 @@ ITables ChangeLog ------------------ **Fixed** +- Table footers continue to work when the notebook is exported to HTML ([#331](https://github.com/mwouts/itables/issues/331)) - The dependencies of the Streamlit component have been updated ([#327](https://github.com/mwouts/itables/pull/327), [#330](https://github.com/mwouts/itables/pull/330)) **Added** diff --git a/src/itables/html/column_filters/pre_dt_code.js b/src/itables/html/column_filters/pre_dt_code.js index 17489b5c..380b3df1 100644 --- a/src/itables/html/column_filters/pre_dt_code.js +++ b/src/itables/html/column_filters/pre_dt_code.js @@ -1,9 +1,8 @@ // Setup - add a text input to each header or footer cell $('#table_id:not(.dataTable) thead_or_tfoot th').each(function () { - let title = $(this).text(); - $(this).html(''); + var input = document.createElement("input"); + input.type = "text"; + input.placeholder = "Search " + $(this).text(); + + $(this).html(input); }); diff --git a/src/itables/javascript.py b/src/itables/javascript.py index 25b51b3b..707278be 100644 --- a/src/itables/javascript.py +++ b/src/itables/javascript.py @@ -60,12 +60,7 @@ try: - import google.colab - - # I can't find out how to suppress the LGTM alert about unused-import - # (Tried with # lgtm[py/unused-import] # noqa: F401) - # So we use the import: - assert google.colab.output + import google.colab # noqa: F401 GOOGLE_COLAB = True except ImportError: @@ -200,8 +195,7 @@ def _table_header( footer = "" return """