T
TanStack3y ago
conscious-sapphire

Render Image or component in cell or header based on value

I am struggling to find example for svelte, on how to build column definition, and potentially add custom parameter e.g. isImage: true which then when I render a table I can use value as an src for image and render image inside cell or header. How do I approach that ?
3 Replies
wise-white
wise-white3y ago
have you solved this url to image?
conscious-sapphire
conscious-sapphire3y ago
searching for answer too.
adverse-sapphire
adverse-sapphire3y ago
In case anyone looks for this
const defaultColumns: ColumnDef<User>[] = [
{
accessorFn: (row) => row.id,
id: "id",
// flexRender allows you to pass props to a component inline
cell: (info) => flexRender(AdminUsersTableEdit, {
id: info.getValue(),
}),
header: () => "ID",
},
]
const defaultColumns: ColumnDef<User>[] = [
{
accessorFn: (row) => row.id,
id: "id",
// flexRender allows you to pass props to a component inline
cell: (info) => flexRender(AdminUsersTableEdit, {
id: info.getValue(),
}),
header: () => "ID",
},
]

Did you find this page helpful?