T
TanStack4y ago
extended-salmon

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
sensitive-blue
sensitive-blue3y ago
have you solved this url to image?
dependent-tan
dependent-tan3y ago
searching for answer too.
deep-jade
deep-jade3y 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?