{ "cells": [ { "cell_type": "markdown", "id": "39d5a377", "metadata": {}, "source": [ "# FixedColumns\n", "\n", "[FixedColumn](https://datatables.net/extensions/fixedcolumns/) is an extension\n", "that let you fix some columns as you scroll horizontally." ] }, { "cell_type": "code", "execution_count": 1, "id": "8172b5af", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "
\n", "\n", "\n", "
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", " \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", " Loading ITables v2.4.1-dev from the init_notebook_mode cell...\n", " (need help?)
\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import string\n", "\n", "import numpy as np\n", "import pandas as pd\n", "\n", "import itables\n", "\n", "itables.init_notebook_mode()\n", "\n", "wide_df = pd.DataFrame(\n", " {\n", " letter: np.random.normal(size=100)\n", " for letter in string.ascii_lowercase + string.ascii_uppercase\n", " }\n", ")\n", "\n", "itables.show(\n", " wide_df,\n", " fixedColumns={\"start\": 1, \"end\": 2},\n", " scrollX=True,\n", ")" ] } ], "metadata": { "jupytext": { "formats": "docs///md:myst,docs/py///py:percent", "notebook_metadata_filter": "-jupytext.text_representation.jupytext_version", "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13 } }, "kernelspec": { "display_name": "itables", "language": "python", "name": "itables" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.12" }, "source_map": [ 13, 20 ] }, "nbformat": 4, "nbformat_minor": 5 }