Material-table: (row number) column

Created on 26 Aug 2019  路  1Comment  路  Source: mbrn/material-table

Hi,

I want to add a column to the table that calculate the row number automatically and should always be there without adding it to columns object, is there a way to implement this functionality.

thanks in advance

number

Most helpful comment

I manged to do it, by accessing tableData.id property, but It would be good if there is a built-in column by default.

const columns = [
    {title: '#', render:(rowData)=>rowData.tableData.id+1} 
]

>All comments

I manged to do it, by accessing tableData.id property, but It would be good if there is a built-in column by default.

const columns = [
    {title: '#', render:(rowData)=>rowData.tableData.id+1} 
]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

VipinJoshi picture VipinJoshi  路  3Comments

lazeebee picture lazeebee  路  3Comments

terapepo picture terapepo  路  3Comments

victorwvieira picture victorwvieira  路  3Comments

Likurg2010 picture Likurg2010  路  3Comments