1.1.1 • Published 5 years ago
react-responsive-table-lightweight v1.1.1
react-responsive-table-lightweight
Lightweight responsive table component for React applications, no dependencies.
Install
npm install --save react-responsive-table-lightweight
Usage
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} />
)
}
}
Instructions
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.
License
MIT © zannix