Lightweight responsive table component for React applications, no dependencies.
npm install --save react-responsive-table-lightweight
import React, { Component } from 'react'
import LTable from 'react-responsive-table-lightweight'
class Example extends Component {
render () {
let columns = {
name: "Name",
surname: "Surname",
address: "Street address"
};
let rows = [
{
name : "John",
surname: "Doe",
address: "Dover Street 18"
},
{
name : "Mark",
surname: "Wilton",
address: "Williams St. 2"
}
];
return (
<LTable rows={rows} columns={columns} styles={false} />
)
}
}
Only two props need to be passed to the component - columns and rows (styles is optional and can be included to extend default styling)
Columns is an object denoting titles of table columns.
Rows is an array of objects where keys of those objects need to match columns keys.
MIT © zannix