Open
Description
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Summary
Hi, I'm trying to implement the @tanstack/react-table
library with the Table
component, but the tr
in the <Table.Head>
component is not accessible, and is hardcoded inside the component. Can make a new component for that element please? Regards.
Here is an example and the link to the library
https://tanstack.com/table/latest/docs/introduction
export default function Table<T>({ data, columns }: TableProps<T>) {
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
});
return (
<table>
<thead>
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}> {/* Here, I want to have access to the tr so I can make header groups */}
{headerGroup.headers.map((header) => (
<th key={header.id}>
{flexRender(
header.column.columnDef.header,
header.getContext()
)}
</th>
))}
</tr>
))}
</thead>
<tbody>
{table.getRowModel().rows.map((row) => (
<tr key={row.id}>
{row.getVisibleCells().map((cell) => (
<td key={cell.id}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</td>
))}
</tr>
))}
</tbody>
</table>
);
}