Select#
The select extension let you select rows (or cells).
The selected_rows
attribute
It is possible to access the selected_rows
back in Python but for this you will have to use, instead of show
, either
the
ITable
Widgetthe
ITable
Dash componentthe
interactive_table
Streamlit component
⚠ When a table has been downsampled, only the visible rows can be selected.
Tip
The select
option also interacts with the buttons
extension. If you click on the CSV or Excel export while having selected some rows, only those rows will be exported - see the example below.
import itables
itables.init_notebook_mode()
itables.show(
itables.sample_dfs.get_countries(html=False),
select=True,
selected_rows=[2, 4, 5],
buttons=["copyHtml5", "csvHtml5", "excelHtml5"],
)
Tip
The select
option accept multiple values, as documented here:
select=True
orselect="os"
let you select using single click, shift-click and ctrl-clickselect="single"
let you select a single rowselect="multi"
for single click selection of multiple rows,select="multi+shift"
, …
With select={"style": "os", "items": "cell"}
you can let the user select specific cells, however the cell selection is not exposed in Python, nor taken into account when exporting the data.