I have this color, quantity, and unit price. I created a blank table cell since there are 4 columns, but it does not still align with the values below. This is what it looks like:
Qty and the unit price are not aligned. How do I fix this?
Codesandbox: Add to Cart Sampled 2 - CodeSandbox
Codes:
<TableContainer key={id + obj.color} component={Paper}>
<Table aria-label="simple table">
<TableHead>
<TableRow>
<TableCell>
Product Name: {obj.name + " " + obj.size}
</TableCell>
<TableCell align="center" colSpan={3}>
Details
</TableCell>
</TableRow>
<TableRow>
<TableCell>Color</TableCell>
<TableCell align="right">Qty.</TableCell>
<TableCell align="right"></TableCell>
<TableCell align="right">Unit Price</TableCell>
</TableRow>
</TableHead>
<TableBody>
{obj.nest.map((nest, idx) => (
<TableRow key={idx}>
<TableCell>{nest.color}</TableCell>
<TableCell>{nest.quantity}</TableCell>
<TableCell>
<IconButton
onClick={(e) =>
handleAdd(
nest.id,
nest.prodName,
nest.price,
nest.size,
nest.cat,
nest.color
)
}
>
<AddIcon color="success" />
</IconButton>
<IconButton onClick={() => handleRemove(nest)}>
<RemoveIcon />
</IconButton>
</TableCell>
<TableCell>
{Number(nest.quantity) * Number(nest.price)}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>