Here I have defined the parent element display:"Grid" and with my child element have defined the gridColumnStart as below. It's working fine with the first element but not with the second child element. Below have attached my code.
return (
<Accordion
sx={{
display: "grid",
gridTemplateColumns: "1fr 2fr 1fr"
}}
>
<AccordionSummary
sx={{
gridColumnStart: "2",
gridColumnEnd: "4"
}}
expandIcon={<ExpandMoreIcon />}
aria-controls="panel1a-content"
id="panel1a-header"
>
<div>
<Typography variant="h1" sx={{ fontSize: "40px" }}>
{props.Title}
</Typography>
<Typography variant="subtitle1">{props.Description}</Typography>
<Button
size="small"
variant="outlined"
sx={{
width: "140px",
textAlign: "center",
marginTop: "10px",
color: "#2196F3",
borderColor: "#2196F3"
}}
>
More details
</Button>
</div>
</AccordionSummary>
<AccordionDetails
sx={{
gridColumnStart: "2",
gridColumnEnd: "3"
}}
>
{props.children}
</AccordionDetails>
</Accordion>
);
So here gridColumnStart and End working with AccordionSummary but not with AccordionDetails.
This is how it looks but I wanted the text to be in the middle. Not sure if the approach I'm heading towards is correct. Would appreciate if someone could help me.
