Column Control#
The columnControl
option lets you add column specific controls.
The examples should give you a quick sense of how to use columnControl
. You are invited to consult the datatables documentation for many more column control examples - see also Allan’s post in which the extension was introduced.
import itables
itables.init_notebook_mode()
df = itables.sample_dfs.get_countries()
Getting started#
The columnControl
option can take as value the list of controls that should be added to the table columns.
itables.show(
df,
columnControl=["order", "colVisDropdown", "searchDropdown"],
ordering={"indicators": False, "handler": False},
)
Loading ITables v2.5.1 from the init_notebook_mode cell...
(need help?) |
Tip
When an ordering option is provided through the columnControl
option,
you probably want to deactivate the default ordering icons - that’s the purpose of
ordering={"indicators": False, "handler": False}
used in the example above.
Drop-downs#
Nested lists are mapped to dropdowns:
itables.show(
df,
columnControl=["order", ["orderAsc", "orderDesc", "search"]],
ordering={"indicators": False, "handler": False},
)
Loading ITables v2.5.1 from the init_notebook_mode cell...
(need help?) |