I have datas which will be populated and displayed in table structure using .map function
What do i want?
I want to make each element as a clickable link. So that the corresponding product will be opened in a new tab
here is the piece of code
<div className="product-section">
<div className="card-body">
<div className="table-scroll">
<table
className={
sortSelectedCategorySetAttributes.length > 1
? "table table-striped table-borderless"
: "column-noscroll"
}
style={{ marginTop: "0px" }}
>
<thead>
<tr>
<th className="sticky-fix">PRODUCT</th>
{sortSelectedCategorySetAttributes &&
sortSelectedCategorySetAttributes.map((attributes, index) => {
return (
<th style={fixedHeader} key={index}>
{" "}
{attributes && attributes.name.toUpperCase()}
</th>
);
})}
</tr>
</thead>
{console.log(rowData)}
<tbody>
{rowData.map(ele => {
return <a href={ele.key}>{ele}</a>;
})}
</tbody>
</table>
</div>
</div>
</div>;