Skip to content

Commit

Permalink
[docs][table] Make the data grid blend in
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Aug 27, 2024
1 parent a32add2 commit 4f494ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions docs/data/material/components/table/DataTable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { DataGrid } from '@mui/x-data-grid';
import Paper from '@mui/material/Paper';

const columns = [
{ field: 'id', headerName: 'ID', width: 70 },
Expand Down Expand Up @@ -35,7 +36,7 @@ const rows = [

export default function DataTable() {
return (
<div style={{ height: 400, width: '100%' }}>
<Paper sx={{ height: 400, width: '100%' }}>
<DataGrid
rows={rows}
columns={columns}
Expand All @@ -46,8 +47,8 @@ export default function DataTable() {
}}
pageSizeOptions={[5, 10]}
checkboxSelection
sx={{ overflow: 'clip' }}
sx={{ border: 0 }}
/>
</div>
</Paper>
);
}
7 changes: 4 additions & 3 deletions docs/data/material/components/table/DataTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { DataGrid, GridColDef } from '@mui/x-data-grid';
import Paper from '@mui/material/Paper';

const columns: GridColDef[] = [
{ field: 'id', headerName: 'ID', width: 70 },
Expand Down Expand Up @@ -35,7 +36,7 @@ const rows = [

export default function DataTable() {
return (
<div style={{ height: 400, width: '100%' }}>
<Paper sx={{ height: 400, width: '100%' }}>
<DataGrid
rows={rows}
columns={columns}
Expand All @@ -46,8 +47,8 @@ export default function DataTable() {
}}
pageSizeOptions={[5, 10]}
checkboxSelection
sx={{ overflow: 'clip' }}
sx={{ border: 0 }}
/>
</div>
</Paper>
);
}
2 changes: 1 addition & 1 deletion docs/data/material/components/table/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This constraint makes building rich data tables challenging.
The [`DataGrid` component](/x/react-data-grid/) is designed for use-cases that are focused on handling large amounts of tabular data.
While it comes with a more rigid structure, in exchange, you gain more powerful features.

{{"demo": "DataTable.js", "bg": "outlined"}}
{{"demo": "DataTable.js", "bg": true}}

## Dense table

Expand Down

0 comments on commit 4f494ad

Please sign in to comment.