I have created a MUI Grid with data in it, using the MUI website to build it and I would like it to look like that:
What I would like my chart to look like
Instead, it looks like this, as though it could not read the "a dense table" property:
Here is my code:
<Card className="flightPlanCard" style={{ maxHeight: 300, overflow: 'auto', backgroundColor: "rgba(255,255,255,.5)" }}>
<TableContainer component={Paper}>
<Table size="small" aria-label="a dense table" >
<TableHead>
<TableRow>
<StyledTableCell>ID</StyledTableCell>
<StyledTableCell align="center">Fréquence</StyledTableCell>
<StyledTableCell align="center">Track</StyledTableCell>
<StyledTableCell align="center">Distance (NM)</StyledTableCell>
<StyledTableCell align="center">Coordonées</StyledTableCell>
<StyledTableCell align="center">Nom/Remarque</StyledTableCell>
</TableRow>
</TableHead>
<TableBody style={{ fontSize: 10 }}>
{rows.map((row) => (
<TableRow key={row.name} style={{ height: 10 }} >
<StyledTableCell component="th" scope="row">
{row.id}
</StyledTableCell>
<StyledTableCell align="center">{row.frequency}</StyledTableCell>
<StyledTableCell align="center">{row.track}</StyledTableCell>
<StyledTableCell align="center">{row.distance}</StyledTableCell>
<StyledTableCell align="center">{row.coordinates}</StyledTableCell>
<StyledTableCell align="center">{row.name}</StyledTableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
</Card>
The TableContainer is inside a Card and I also get Warnings when running my app:
Material-UI: The key `row` provided to the classes prop is not implemented in ForwardRef(TableCell).
You can only override one of the following: root,head,body,footer,sizeSmall,paddingCheckbox,paddingNone,alignLeft,alignCenter,alignRight,alignJustify,stickyHeader.
How can I fix this?
Thanks in advance