Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.46 KB

File metadata and controls

60 lines (42 loc) · 1.46 KB

react-responsive-table-lightweight

Lightweight responsive table component for React applications, no dependencies.

NPM JavaScript Style Guide

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