Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
How to get AntD expanded Table to display nested dataSource values

I have to dynamically render some data into antD expandable table. The data is a nested object with various properties -

const values = [
    [name = 'Josh', city = 'Sydney', pincode='10000'],
    [name = 'Matthew', city = 'London', pincode = '20000'],
    [name = 'Roger', city = 'Paris', pincode = '2300'],
]

How can I display this data in an antD table? The dataSource = {values} gives an empty table. Kindly guide me. How to display nested array values in the antD table?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

First of all, the data you are trying to pass is totally wrong, it should be an array of objects,

const values = [
  {key: '1', name: 'Josh', city: 'Sydney', pincode:'10000'},
  {key: '1',name:'Matthew', city: 'London', pincode:'20000'},
  {key: '3',name: 'Roger', city:'Paris', pincode: '2300'},
]

and second, as you read the Table sample code given on documentation, you also need to pass the table's header,

const columns = [
  {
    title: 'Name',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: 'City',
    dataIndex: 'city',
    key: 'city',
  },
  {
    title: 'Pincode',
    dataIndex: 'pincode',
    key: 'pincode',
  },
]
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!