Installation
material-ui-table is available as an npm package.npm i material-ui-table
Usage
import React from 'react';
import Table from 'material-ui-table';
export default class MyAwesomeReactComponent extends React.Component {
constructor(props) {
super(props);
}
render(){
let columns=[
{key:'id',label:'ID'},
{key:'title',label:'Title'},
{key:'link',label:'Link'},
];
let data=[{
id:1,
title:'React',
link:<a href="https://github.com/facebook/react">React</a>,
_selected:true, //Table Row Props
_striped:false
},{
id:2,
title:'Material UI',
link:<a href="https://github.com/callemall/material-ui"/>Material UI</a>
}];
return (
<Table
columns={columns}
data={data}
/>
)
}
}
Props
headerobject
Table Header Propsbody
object
Table Body Propstitle
string
footer
string
columns
array
data
array
...others Table Props