import React, {Component} from 'react';
import ReactTable from 'react-table';
class Table extends Component {
render() {
const tableData = [{name:"Saiful",age:"28"},{name:"Saiful",age:"28"},{name:"Saiful",age:"28"},{name:"Saiful",age:"28"}]
const tableColumns = [{Header: "Name", accessor: "name"},{Header: "Age", accessor: "age"}]
return (
<div>
<ReactTable
data = {tableData}
columns = {tableColumns}
defaultPageSize={2}
pageSizeOptions={[2,4,6,8]}
/>
</div>
);
}
}
export default Table;
Asked
Active
Viewed 82 times
0

buzatto
- 9,704
- 5
- 24
- 33

Md Saiful Islam
- 21
- 3
-
Could you post the code in `app.js` file, where you import `Table`? – Mu-Majid Jan 20 '21 at 12:18
-
Another question, I have checked the documentation for react-table and did not find an example using ReactTable component? . To be honest, I checked the quick start section very fast. – Mu-Majid Jan 20 '21 at 12:23
-
import logo from './logo.svg'; import './App.css'; import Test from "./mycomponents/Test"; import Post from "./mycomponents/Post"; import DataTable from "./mycomponents/DataTable"; function App() { return ({/*); } export default App; – Md Saiful Islam Jan 20 '21 at 12:39
*/} {/* */} -
try to change
to – Mu-Majid Jan 20 '21 at 12:43, both in the import statement, and in the app function
-
At Frist, I use
but don't work..And react-table don't have any CSS file
– Md Saiful Islam Jan 20 '21 at 12:48