import { Table } from "css-materials";
Define the structure and display labels of each column in the table using the columns array, and define the data rows to be displayed in the table using the data array.
Name | Age | Address |
---|---|---|
John Doe | 28 | 1234 Elm St |
Jane Smith | 34 | 5678 Oak St |
const columns = [
{ key: 'name', label: 'Name' },
{ key: 'age', label: 'Age' },
{ key: 'address', label: 'Address' },
];
const data = [
{ name: 'John Doe', age: 28, address: '1234 Elm St' },
{ name: 'Jane Smith', age: 34, address: '5678 Oak St' },
];
<Table columns={columns} data={data} />