Antd Table in React

10,815

You can render the column by your self like this

<Column
    title="First Name"
    key="firstName"
    render={(text, record) => (
        <div>{record.name[0]}</div>
    )}
/>
Share:
10,815
DadyByte
Author by

DadyByte

Fullstack Developer with expertise in Frontend technologies

Updated on June 29, 2022

Comments

  • DadyByte
    DadyByte almost 2 years

    I am creating a react app using antd in React. I want to create an Antd Table.

    I am following this syntax: https://ant.design/components/table/#components-table-demo-jsx

    In the dataSource I don't want separate names like firstName or lastName. I want one array object

    name:["firstName","lastName"]
    

    The problem is I am not able to load or render this data in the <Column /> tag inside the <Table /> tag.

  • fires3as0n
    fires3as0n over 4 years
    Can you please tell, what is the difference between text and record arguments - documentation as usually says nothing, and logging them into console gives me similar result for both of them.