Skip to content
Discussion options

You must be logged in to vote

As in v8 the way cells are rendered has changed, you should be able to calculate custom class name when rendering the table. A quick idea that came to my mind would be to try something like this:

  <tbody>
        {table.getRowModel().rows.map(row => (
          <tr key={row.id}>
            {row.getVisibleCells().map(cell => (
              <td className={cell.column.id === 'Driver' ? getCellClassName(cell.row.original) : undefined}>
                {flexRender(cell.column.columnDef.cell, cell.getContext())}
              </td>
            ))}
          </tr>
        ))}
      </tbody>

Where you define a custom function getCellClassName() and then you can use cell.row.original to access…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RobertasP
Comment options

Answer selected by RobertasP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants