I have a const, which should be shown as a table in browser, using method MAP. The problem is below (Cars shown not in a table). Could someone help?
`const topCars = [
{manufacturer:'Fiat', model:'m5'},
{manufacturer:'Nissan', model:'e6'},
{manufacturer:'Lexus', model:'r'}
]
`
My code:
`export type NewComponentType = {
cars: CarsType[]
}
export type CarsType = {
manufacturer: string
model: string
}
export const NewComponents = (props: NewComponentType) => {
return (
<>
{props.cars.map((objectFromCarsTypeArray, index) => {
return (
<table>
<thead key={index}>
</thead>
<tr>
<td>{objectFromCarsTypeArray.manufacturer}</td>
<td>{objectFromCarsTypeArray.model}</td>
</tr>
</table>
)
})}
</>
);
};
`
And how it shown in browser:
Fiat m5
Nissan e6
Lexus r
tried: Rename table tags – nothing happenned