Interactive Tables in HTML presentations
Loading ITables v2.9.0 from the init_notebook_mode cell...
(need help?)
|
| ⓘ | region | country | capital | longitude | latitude |
|---|---|---|---|---|---|
| code | |||||
| AW | Latin America & Caribbean | Aruba | Oranjestad | -70.016700 | 12.516700 |
| AF | South Asia | Afghanistan | Kabul | 69.176100 | 34.522800 |
| AO | Sub-Saharan Africa | Angola | Luanda | 13.242000 | -8.811550 |
| AL | Europe & Central Asia | Albania | Tirane | 19.817200 | 41.331700 |
| AD | Europe & Central Asia | Andorra | Andorra la Vella | 1.521800 | 42.507500 |
| (203 more rows not shown) | |||||
How to make your table smaller
lengthMenu,cssThis document uses
from IPython.display import display, HTML
# show 5 rows per 'page'
itables.options.lengthMenu = [5]
# don't show the length control
itables.options.layout["topStart"] = None
# use a smaller font (default is medium)
# see https://developer.mozilla.org/en-US/docs/Web/CSS/font-size
display(HTML("<style>.dt-container { font-size: medium; }</style>"))Parameters
ITables’ advanced parameters:
itables.options, orshow function.show.Global Options and Quarto’s cache
Quarto uses a cache that may prevent your changes on itables.options to become effective when you run quarto render.
In that case, use --cache-refresh or even --execute-daemon-restart.
GitHub Star
ITables is developed by Marc Wouts on GitHub, under a MIT license. ITables is a wrapper for datatables.net which is developed by Allan Jardine (sponsor him!), also under a MIT license.
Under the hood
ITables renders Pandas or Polars DataFrames as interactive HTML tables using the JavaScript DataTables library.
Documentation
Learn More about ITables in the documentation.