es6-react-admin-lte
Version:
An AdminLTE Template made to use for React and ES2015-and-so-on
85 lines (75 loc) • 1.84 kB
Markdown
# TITLE
> ./src/js/components/table/simple-table/simple-table.jsx
## Purpose
To display data on a simple table. It doesn't modify or do anything special with the data other than display it on a table.
## Props
__striped__
* Required - _false_
* Data Type - _BOOLEAN_
* Functionality - _Differentiates between rows by making each row a different color from the adjacent ones_
* Default - _false_
__condensed__
* Required - _false_
* Data Type - _BOOLEAN_
* Functionality - _Makes the table rows thinner_
* Default - _false_
__bordered__
* Required - _false_
* Data Type - _BOOLEAN_
* Functionality - _Gives the rows and cells a border_
* Default - _false_
__hovers__
* Required - _false_
* Data Type - _BOOLEAN_
* Functionality - _Changes the color of the rows when a user hovers over them._
* Default - _false_
__headers__
* Required - _false_
* Data Type - _ARRAY_
* Functionality - _The headers that can accompany data, indicating more information on what the data is_
* Expected Data -
```json
const headers = [
{ id: 'cell0', content: 'Column #1'},
{ id: 'cell1', content: 'Column #2'},
{ id: 'cell2', content: 'Column #3'}
];
```
* Default - _[]_
__data__
* Required - _false_
* Data Type - _ARRAY_
* Functionality - _The data that will display in the table's cells_
* Expected Data -
```json
const data = [
{
cell0: 'Some',
cell1: 'Test',
cell2: 'Data'
},
{
cell0: 1000,
cell1: 750,
cell2: 420
},
{
cell0: <p>Element Test Data</p>,
cell1: <p>Same Here</p>,
cell2: <p>and here...</p>
}
];
```
* Default - _[]_
## Example
```javascript/jsx
import SimpleTable from './src/js/components/table/simple-table/simple-table.jsx';
<SimpleTable
striped
condensed
bordered
hovers
headers={headers}
data={data}
/>
```