Hi Im starting with the reactjs. After working with the basics in react, Im trying to work on the reactjs with dynamoDB. First query Im working on is Select query, and render the table in html file. So right now Im able to get the json array from desired table using select query. But Im not able display the rendered data in a table format i.e I get a json array like below and able to display data 4281, taniv, secondary... but not able to display the header for each value (id, name, class, etc.), so how to display the header for each json value. I want it to be dynamic because I want to show what is in the db(if some of the attributes are not there or missing I don't want it to be displayed) :
This an example I refered to get the data from db
[
{
"id": 4281,
"name": "taniv",
"class": "secondary",
"admission": 227,
"telephone": "209-109-2322",
"address": "11 first lane",
"postCode": "5788009",
"county": "UK",
}]
js
<div id="third" >
<label> Result </label>
<br />
<table>
<tbody>
<tr>
<th> </th>
</tr>
<tr>
{data.map((obj, y) => {
return Object.keys(obj).map((x, y) => <td> {obj[x]} </td>)
})}
</tr>
</tbody>
</table>
<Paginator>