Material-table: Add image type to field display

Created on 18 Jun 2019  路  2Comments  路  Source: mbrn/material-table

I need to add image display in field Thumbnail, but now in type of display have only Data type: 'boolean', 'numeric', 'date', 'datetime', 'time', 'currency'

How can I add image to display, if exist feature, please let's me know more information. Thank you!

help wanted

Most helpful comment

You can use the custom render method of the cell. Please have a look at the custom rendering section. It has an example with an image, I think.

All 2 comments

You can use the custom render method of the cell. Please have a look at the custom rendering section. It has an example with an image, I think.

create custom component:
like const Image=

    <MaterialTable
      columns={[
      **{ title: 'Ad谋', field: 'render' },**
        { title: 'Ad谋', field: 'name' },
        { title: 'Soyad谋', field: 'surname' },
        { title: 'Do臒um Y谋l谋', field: 'birthYear', type: 'numeric' },
        { title: 'Do臒um Yeri', field: 'birthCity', lookup: { 34: '陌stanbul', 63: '艦anl谋urfa' } }
      ]}
      data={[{ **render:Image,** name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63 }]}
      title="Demo Title"
    />

it should work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

revskill10 picture revskill10  路  3Comments

behrouz-s picture behrouz-s  路  3Comments

VipinJoshi picture VipinJoshi  路  3Comments

kfirshahar picture kfirshahar  路  3Comments

jlgreene2 picture jlgreene2  路  3Comments