State Save

State Save#

To preserve the table state, like the selected columns or the row order you can use the stateSave option. This will preserve the table state when the page is reloaded, or when an ITable component is updated.

Tip

You might also want to adjust stateDuration which defaults to 2 hours.

Try the option on this page: re-order the table by clicking on one column, then refresh the page - the order will be preserved.

import itables

itables.init_notebook_mode()

df = itables.sample_dfs.get_countries()

itables.show(df, stateSave=True)
region country capital longitude latitude
code
AWLatin America & Caribbean ArubaOranjestad-70.01670012.516700
AFSouth AsiaAfghanistanKabul69.17610034.522800
AOSub-Saharan Africa AngolaLuanda13.242000-8.811550
ALEurope & Central AsiaAlbaniaTirane19.81720041.331700
ADEurope & Central AsiaAndorraAndorra la Vella1.52180042.507500
AEMiddle East & North AfricaUnited Arab EmiratesAbu Dhabi54.37050024.476400
ARLatin America & Caribbean ArgentinaBuenos Aires-58.417300-34.611800
AMEurope & Central AsiaArmeniaYerevan44.50900040.159600
ASEast Asia & PacificAmerican SamoaPago Pago-170.691000-14.284600
AGLatin America & Caribbean Antigua and BarbudaSaint John's-61.84560017.117500
(198 more rows not shown)