Table

Overview

Table is a component for displaying data in rows and columns.

Import

import { Table } from "css-materials";

Usage

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.

NameAgeAddress
John Doe281234 Elm St
Jane Smith345678 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} />