Skip to content

Instantly share code, notes, and snippets.

@Jon20111
Created July 18, 2020 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jon20111/008045442752191c63c6228626439db6 to your computer and use it in GitHub Desktop.
Save Jon20111/008045442752191c63c6228626439db6 to your computer and use it in GitHub Desktop.
basic material-table
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