This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Name | Type | Default | isRequired |
---|---|---|---|
columns |
[ ] | - | yes |
data |
[ ] | - | yes |
onRowSelected |
( row ) => row.item | ( ) => { } | no |
rowStyle |
CSSProperties | { width: 100, height: 60 } | no |
cellStyle |
CSSProperties | { } | no |
editable |
boolean | true | no |
[
{
id: string,
firstname: string,
lastname: string,
email: string
},
]
const columns: IColumn<ITemp>[] = [
{
name: "Firstname",
selector: row => row.firstname,
},
{
name: "Lastname",
selector: row => row.lastname,
},
{
name: "Email",
selector: row => row.email
},
];
<DataTable
data={data}
columns={columns}
onRowSelected={(item) => console.log(item)} // {id: 0, firstname: 'tolga', lastname: 'yonca', email: '[email protected]' }
rowStyle={{ width: 100, height: 60 }}
editable
// cellStyle={{background:'red'}}
/>