Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add an image to a cell Table in Ant Design Tables?

I am trying to create a column that in his entries will include a small picture and a name. How can I do so using Ant Design's table?

https://ant.design/components/table/ I can't seem to find anything related in the docs or the examples.

like image 704
Randomizer Avatar asked Nov 13 '18 23:11

Randomizer


1 Answers

If you were using the table in a similar way as to the examples shown in their docs.(Using a datasource array)

You could do something like this

const columns = [
 {
    title: '',
    dataIndex: 'image_URL_here',
    render:  () => <img src={`image_URL_here`} />
 }
]
like image 144
Elliot Avatar answered Oct 16 '22 02:10

Elliot