DEV Community

Discussion on: An easy way to create a customize dynamic table in react js

Collapse
 
abdulbasit313 profile image
Abdul Basit • Edited

Here you go... you just need to change renderTableData function with below code. Let me know if it helps...

   renderTableData() {
      return this.state.students.map((student, index) => {
         let col = Object.keys(student)
         return (
            <tr key={student.id}>
               {col.map((val, index) => {
                  return <td key={index}>{student[col[index]]}</td>
               })}
            </tr>
         )
      })
   }
Collapse
 
hirupiyumika profile image
hirupiyumika

Thank you very much...!! It is very helpful.

Collapse
 
ronaldoperes profile image
Ronaldo Peres

Thank you,

How can I hide the first column?

Collapse
 
datmt profile image
Mạnh Đạt

Thank you!