T
TanStack3y ago
ambitious-aqua

Static row id

Hey, not familiar with usememo, i have sortable table. I need static id numbers, first row always start from 1. After every rerender table.
{
id: "Row",
header: "#",
cell: (row) => {
return <span>{row.row.index + 1}</span>;
},
},
{
id: "Row",
header: "#",
cell: (row) => {
return <span>{row.row.index + 1}</span>;
},
},
1 Reply
ambitious-aqua
ambitious-aquaOP3y ago
Solved it adding
<th className={styles.th}>#</th> and {table.getRowModel().rows.map((row, index) => {
return (
<tr key={row.id}>
<td className={styles.td}>{index + 1}</td>
<th className={styles.th}>#</th> and {table.getRowModel().rows.map((row, index) => {
return (
<tr key={row.id}>
<td className={styles.td}>{index + 1}</td>
to the html table.

Did you find this page helpful?