Created
July 18, 2020 01:23
-
-
Save Jon20111/008045442752191c63c6228626439db6 to your computer and use it in GitHub Desktop.
basic material-table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import "./styles.css"; | |
import MaterialTable from "material-table"; | |
export default function App() { | |
const [data, setData] = useState([ | |
{ name: "Jon", job: "Software Dev", age: 29 } | |
]); | |
return ( | |
<div className="App"> | |
<h1>Material-Table Demo</h1> | |
<div style={{ maxWidth: "100%" }}> | |
<MaterialTable | |
columns={[ | |
{ | |
title: "Name", | |
field: "name" | |
}, | |
{ | |
title: "Occupation", | |
field: "job" | |
}, | |
{ | |
title: "Age", | |
field: "age", | |
type: "numeric" | |
} | |
]} | |
data={data} | |
title="Material-Table Demo" | |
/> | |
</div> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment