import React from 'react' import styled from 'styled-components' import { useTable } from 'react-table' import makeData from './makeData' const Styles = styled.div` padding: 1rem; table { border-spacing: 0; border: 1px solid black; tr { :last-child { td { border-bottom: 0; } } } th, td { margin: 0; padding: 0.5rem; border-bottom: 1px solid black; border-right: 1px solid black; :last-child { border-right: 0; } } } ` function Table({ columns, data }) { // Use the state and functions returned from useTable to build your UI const { getTableProps, headerGroups, rows, prepareRow } = useTable({ columns, data, }) // Render the UI for your table return (
| {column.render('Header')} | ))}
|---|
| {cell.render('Cell')} | })}