I am trying to fetch JSON data and create a table using it with table heading. I've done it successfully but the problem is that the table is not displayed properly.
render(){
return(
<div className='container'>
<table>
<thead>
<tr>
<th>User_Name</th>
<th>Address</th>
<th>Date Of Birth</th>
<th>Email</th>
<th>Profile Picture</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{this.state.arr.map((card)=>{
return(
<div>
<tr>
<td>{card.user_name}</td>
<td>{card.address}</td>
<td>{card.date_of_birth}</td>
<td>{card.email}</td>
<td>{card.profile_picture}</td>
<td><button className="btn btn-outline-primary ml-2 my-2 my-sm-0">Edit</button></td>
<td><button className="btn btn-outline-primary ml-2 my-2 my-sm-0">Delete</button></td>
</tr>
</div>
) })}
</tbody>
</table>
and the table looks like this :
https://screenshots.firefox.com/7i07VlkEFYlAj8ga/mrigank.com
I want the table to be properly arranged.