I am utilizing React Material UI along with the Box component to style my form. In this scenario, I have 4 items in each row except for the last row where I need to display only 3 items with the last item filling the entire row by merging two elements together. How can I achieve this when the Box component divides all my rows into 4 columns?
Here is my code:
<Box
sx={{
display: 'grid',
columnGap: 2,
rowGap: 3,
gridTemplateColumns: {xs: 'repeat(7, 1fr)',
sm: 'repeat(4, 1fr)'},
}}
>
First row with 4 columns:
<TextField ....>
<TextField ....>
<TextField ....>
<TextField ....>
Second row with 3 columns:
<TextField ....>
<TextField ....>
//This column should span across two columns.
<TextField ....>
</Box>