Is there a way to display the row numbers? One of my tables is ranking assets and it would be very helpful for the users to see if an asset is ranked, for example, 28 or 12. Thanks!
See the customBodyRender/customBodyRenderLite methods. customBodyRender has a rowIndex on the tableMeta object and customBodyRenderLite takes in a rowIndex parameter. You can use this value for the display.
Thanks. For future searches here's the code I used. I added a column as the first one:
{
name: '',
label: '',
options: {filter: false,
customBodyRender : (value, tableMeta, update) => {
let rowIndex = Number(tableMeta.rowIndex) + 1;
return ( <span>{rowIndex}</span> )
}
},
},
Most helpful comment
Thanks. For future searches here's the code I used. I added a column as the first one: