Skip to content

Commit

Permalink
Update StickyHeadTable.tsx
Browse files Browse the repository at this point in the history
Signed-off-by: MachaVivek <[email protected]>
  • Loading branch information
MachaVivek authored Jan 23, 2025
1 parent 6494973 commit 522740c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions docs/data/material/components/table/StickyHeadTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function StickyHeadTable() {

return (
<Paper sx={{ width: '100%', overflow: 'hidden' }}>
<Table aria-label="sticky table">
<Table stickyHeader aria-label="sticky table">
<TableHead>
<TableRow>
{columns.map((column) => (
Expand All @@ -109,7 +109,20 @@ export default function StickyHeadTable() {
</TableHead>
</Table>
<TableContainer sx={{ maxHeight: 440 }}>
<Table>
<Table stickyHeader aria-label="sticky table">
<TableHead>
<TableRow>
{columns.map((column) => (
<TableCell
key={column.id}
align={column.align}
style={{ minWidth: column.minWidth }}
>
{column.label}
</TableCell>
))}
</TableRow>
</TableHead>
<TableBody>
{rows
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
Expand All @@ -132,7 +145,6 @@ export default function StickyHeadTable() {
</TableBody>
</Table>
</TableContainer>

<TablePagination
rowsPerPageOptions={[10, 25, 100]}
component="div"
Expand Down

0 comments on commit 522740c

Please sign in to comment.