Here I have stored attribute tag in string which is in an object of an array, here I am rendering it using map function, but it is not converting it back from string to an attribute.
Please tell me how can I achieve this.
Here is the render part of my code.
return (
<div className="gm panel panel-default table-responsive">
<table className="displayresults">
<thead>
<tr>
<th width="200"></th>
{dates.map((date, index) => {
return (
<th width="100">
<div className="dt">{date}</div>
</th>
);
})}
</tr>
</thead>
<tbody>
{row.map((info, index) => {
return (
<tr>
<td>
<div className="up">{info.name}</div>
<div className="down">
{info.address}, {info.district_name}, {info.state_name},{" "}
{info.pincode}
</div>
</td>
<td>{info.dt1}</td>
<td>{info.dt2}</td>
<td>{info.dt3}</td>
<td>{info.dt4}</td>
<td>{info.dt5}</td>
<td>{info.dt6}</td>
<td>{info.dt7}</td>
</tr>
);
})}
</tbody>
</table>
</div>
);
Here info.dt1
, info.dt2
..... is a string. How can I print it as an attribute here so that my code renders perfectly? I am also providing output, for better a better understanding, below.