ClassicTable
Last updated
Last updated
ClassicTable
is a widget in Supervisely that is used for displaying and manipulating data in a table format. It is similar to the Table
widget but with fewer customization options and functionalities.
Note, that this is a legacy version. It is recommended to use the newer Table
widget instead.
or
data
pd.DataFrame()
or dict
Data of table
columns
list
List of columns names
fixed_columns_num
int
Number of fixed columns (left to right)
widget_id
str
ID of the widget
Data of table in different formats:
Pandas Dataframe:
Python dict with structure:
List of columns names.
type: list
default value: None
Number of fixed colums (left to right).
type: int
default value: None
ID of the widget.
type: str
default value: None
fixed_columns_num
Get or set number of fixed columns (left to right) property.
to_json()
Convert table data to json.
to_pandas()
Convert table data to pandas dataframe.
read_json(value: dict)
Read and set table data from json.
read_pandas(value: pd.DataFrame)
Read and set table data from pandas dataframe.
insert_row(index=-1)
Insert new row in table.
pop_row(value: pd.DataFrame)
Remove row from table by index.
get_selected_cell(state)
Get selected table cell info.
You can find this example in our Github repository:
ui-widgets-demos/tables/002_classic_table/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Create data for table.
ClassicTable
widgetor you can initialize empty table and set data later.
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.