Hi I use react js and I'm new. I want to use Table pagination material-ui for a table that does not belong to material-ui.For example, I want 2 row per page.I use the reactStrap table. If possible, tell me how to do it.
render() {
const items = this.props.items.map(item => {
return (
<tr key={item.id}>
<td>
<div style={{ width: "110px" }}>
<Button
color="success"
buttonLabel="Edit"
item={item}
updateState={this.props.updateState}
>
Edit
</Button>
<Button color="danger" onClick={() => this.deleteItem(item.id)}>
Del
</Button>
</div>
</td>
<th scope="row">{item.id}</th>
<td>{item.name}</td>
<td>{item.username}</td>
<td>{item.email}</td>
</tr>
);
});
return (
<div
style={{
maxHeight: "600px",
overflowY: "auto"
}}
>
<Table responsive hover>
<thead>
<tr>
<th>Action</th>
<th>ID</th>
<th>name</th>
<th>username</th>
<th>email</th>
</tr>
</thead>
<tbody>{items}</tbody>
</Table>
</div>
);
}
}
You can see my table in CodeSandbox.Thanks in advance for your answers