{
"cells": [
{
"cell_type": "markdown",
"id": "781740c2",
"metadata": {},
"source": [
"# State Save\n",
"\n",
"To preserve the table state, like the [selected columns](colvis.md) or the [row order](order.md) you can use the [`stateSave`](https://datatables.net/reference/option/stateSave) option. This will preserve the table state when the page is reloaded, or when an ITable component is updated.\n",
"\n",
"```{tip}\n",
"You might also want to adjust [`stateDuration`](https://datatables.net/reference/option/stateDuration) which defaults to 2 hours.\n",
"```\n",
"\n",
"Try the option on this page: re-order the table by clicking on one column, then refresh the page - the order will be preserved."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "d7bf8ca8",
"metadata": {
"tags": [
"full-width"
]
},
"outputs": [
{
"data": {
"text/html": [
"\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"