Sticky cells in header in MUI

I have table made with MUI. Problem: I can’t make all the header to be sticky. It only makes sticky
雇用形態, 応募経路 and months cells. But “FY23” is completely ignored and always hidden when scrolling. Can it be fixed?

`const ScrollableTable = ({ data }) => {
const counts = processData(data);
const isSmallScreen = useMediaQuery(‘(max-width: 1366px)’);

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>return (
<TableContainer component={Paper} style={{ maxHeight: 500 }}>
<Table stickyHeader aria-label="sticky table" style={{ minWidth: isSmallScreen ? 650 : '100%' }}>
<TableHead>
<StyledTableRow>
<StyledTableCell colSpan={14} align="center" style={{ backgroundColor: '#3c3e42', color: 'white', fontWeight: 'bold', fontSize: '1.2rem' }}>
内定者一覧
</StyledTableCell>
</StyledTableRow>
<StyledTableRow>
<StyledTableCell rowSpan={3} align="center">雇用形態</StyledTableCell>
<StyledTableCell rowSpan={3} align="center">応募経路</StyledTableCell>
<StyledTableCell colSpan={12} align="center" aria-label="sticky table">FY23</StyledTableCell>
</StyledTableRow>
<StyledTableRow>
{japaneseMonths.map(month => (
<StyledTableCell key={`month-${month}`}>{month}</StyledTableCell>
))}
</StyledTableRow>
</TableHead>
<TableBody>
{Object.keys(counts).map((category) => (
<React.Fragment key={`category-${category}`}>
<StyledTableRow key={`category-row-${category}`}>
<StyledTableCell rowSpan={10} align="center">{category}</StyledTableCell>
<StyledTableCell>{'全体数'}</StyledTableCell>
{counts[category]['全体数'].map((count, idx) => (
<StyledTableCell key={`total-${category}-${idx}`}>{count}</StyledTableCell>
))}
</StyledTableRow>
{Object.keys(counts[category]).filter(route => route !== '全体数').map((route) => (
<StyledTableRow
key={`route-${category}-${route}`}
sx={{ backgroundColor: route === '入社確定' ? '#fabf34' : 'inherit' }}
>
<StyledTableCell>{route}</StyledTableCell>
{counts[category][route].map((count, idx) => (
<StyledTableCell key={`route-count-${category}-${route}-${idx}`}>{count}</StyledTableCell>
))}
</StyledTableRow>
))}
</React.Fragment>
))}
</TableBody>
</Table>
</TableContainer>
);
</code>
<code>return ( <TableContainer component={Paper} style={{ maxHeight: 500 }}> <Table stickyHeader aria-label="sticky table" style={{ minWidth: isSmallScreen ? 650 : '100%' }}> <TableHead> <StyledTableRow> <StyledTableCell colSpan={14} align="center" style={{ backgroundColor: '#3c3e42', color: 'white', fontWeight: 'bold', fontSize: '1.2rem' }}> 内定者一覧 </StyledTableCell> </StyledTableRow> <StyledTableRow> <StyledTableCell rowSpan={3} align="center">雇用形態</StyledTableCell> <StyledTableCell rowSpan={3} align="center">応募経路</StyledTableCell> <StyledTableCell colSpan={12} align="center" aria-label="sticky table">FY23</StyledTableCell> </StyledTableRow> <StyledTableRow> {japaneseMonths.map(month => ( <StyledTableCell key={`month-${month}`}>{month}</StyledTableCell> ))} </StyledTableRow> </TableHead> <TableBody> {Object.keys(counts).map((category) => ( <React.Fragment key={`category-${category}`}> <StyledTableRow key={`category-row-${category}`}> <StyledTableCell rowSpan={10} align="center">{category}</StyledTableCell> <StyledTableCell>{'全体数'}</StyledTableCell> {counts[category]['全体数'].map((count, idx) => ( <StyledTableCell key={`total-${category}-${idx}`}>{count}</StyledTableCell> ))} </StyledTableRow> {Object.keys(counts[category]).filter(route => route !== '全体数').map((route) => ( <StyledTableRow key={`route-${category}-${route}`} sx={{ backgroundColor: route === '入社確定' ? '#fabf34' : 'inherit' }} > <StyledTableCell>{route}</StyledTableCell> {counts[category][route].map((count, idx) => ( <StyledTableCell key={`route-count-${category}-${route}-${idx}`}>{count}</StyledTableCell> ))} </StyledTableRow> ))} </React.Fragment> ))} </TableBody> </Table> </TableContainer> ); </code>
return (
    <TableContainer component={Paper} style={{ maxHeight: 500 }}>
        <Table stickyHeader aria-label="sticky table" style={{ minWidth: isSmallScreen ? 650 : '100%' }}>
            <TableHead>
            <StyledTableRow>
                    <StyledTableCell colSpan={14} align="center" style={{ backgroundColor: '#3c3e42', color: 'white', fontWeight: 'bold', fontSize: '1.2rem' }}>
                        内定者一覧
                    </StyledTableCell>
                </StyledTableRow>
                <StyledTableRow>
                    <StyledTableCell rowSpan={3} align="center">雇用形態</StyledTableCell>
                    <StyledTableCell rowSpan={3} align="center">応募経路</StyledTableCell>
                    <StyledTableCell colSpan={12} align="center" aria-label="sticky table">FY23</StyledTableCell>
                </StyledTableRow>
                <StyledTableRow>
                    {japaneseMonths.map(month => (
                        <StyledTableCell key={`month-${month}`}>{month}</StyledTableCell>
                    ))}
                </StyledTableRow>
            </TableHead>
            <TableBody>
                {Object.keys(counts).map((category) => (
                    <React.Fragment key={`category-${category}`}>
                        <StyledTableRow key={`category-row-${category}`}>
                            <StyledTableCell rowSpan={10} align="center">{category}</StyledTableCell>
                            <StyledTableCell>{'全体数'}</StyledTableCell>
                            {counts[category]['全体数'].map((count, idx) => (
                                <StyledTableCell key={`total-${category}-${idx}`}>{count}</StyledTableCell>
                            ))}
                        </StyledTableRow>
                        {Object.keys(counts[category]).filter(route => route !== '全体数').map((route) => (
                            <StyledTableRow
                                key={`route-${category}-${route}`}
                                sx={{ backgroundColor: route === '入社確定' ? '#fabf34' : 'inherit' }}
                            >
                                <StyledTableCell>{route}</StyledTableCell>
                                {counts[category][route].map((count, idx) => (
                                    <StyledTableCell key={`route-count-${category}-${route}-${idx}`}>{count}</StyledTableCell>
                                ))}
                            </StyledTableRow>
                        ))}
                    </React.Fragment>
                ))}
            </TableBody>
        </Table>
    </TableContainer>
);

};`

I did not found anything in documentation about it. Nor anything in the Internet.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật