Select Text in Header

Select Text in Header#

The text_in_header_can_be_selected option, which defaults to True, is provided by ITables since v2.4.0.

With that option set (the default), you can select the text in the table headers. This is useful in the context of data exploration where you need to copy back the column name to your code.

import itables

itables.init_notebook_mode()
df = itables.sample_dfs.get_countries(html=False)

itables.show(df, "A table in which column headers can be selected")
Loading ITables v2.4.0 from the init_notebook_mode cell... (need help?)

When text_in_header_can_be_selected=False, the column title cannot be selected as clicking on the title sorts the table.

itables.show(
    df,
    "A table in which column headers cannot be selected",
    text_in_header_can_be_selected=False,
)
Loading ITables v2.4.0 from the init_notebook_mode cell... (need help?)