Is there a way to add row numbers for a dashtable?

I want to add row numbers 1 through nrow(df) that stays when filtered, sorted etc. Does dashtable support that?

Hi @schnetzlerjoe

Yes, the DataTable supports both row numbers and row_id

Before you sort or filter your df, you can create a row id like this:

df['id'] = df.index

See more information in the section called “Row IDs” here

1 Like