Getting started
Minimalist fully responsive table for ReactJS by Cacilie
Installing.
1
npm i -s react-minimalist-table
Copied!
Copy this code at you project in order to have a fully responsive table.
1
import './App.css';
2
import {CTable} from 'react-minimalist-table';
3
import {useEffect, useState} from 'react';
4
5
function App() {
6
7
const [Data, setData] = useState([])
8
9
useEffect(() => {
10
fetch('https://jsonplaceholder.typicode.com/posts')
11
.then(response => response.json())
12
.then(json => setData(json))
13
}, [])
14
15
return (
16
<div className="App">
17
<CTable
18
caption={"Data"}
19
data={Data}
20
/>
21
</div>
22
);
23
}
24
25
export default App;
26
Copied!

Props.

caption
Title of the table to be displayed
data
JSON array with the data to be displayed

Data example.

1
[{
2
columnName: cellValue,
3
columnName2: cellValue2,
4
}]
Copied!
Last modified 8mo ago
Copy link