Skip to content

olitaylor/react-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-table-component

Simple table component that takes an array of table columns and data to render.

NPM

$ npm install dynamic-react-table

Register the component

import table from 'dynamic-react-table';

Basic markup should look like this

<Table 
  head={ tableProps.tableHeadings } 
  data={ tableProps.tableContent }
  placeholder={ tableProps.placeholder } 
  parentClass={ tableProps.parentClass }/>

Props

const tableProps = {
  tableHeadings: ['Make', 'Model', 'Color', 'Engine'],
  tableContent: [
    { make: 'Ford', model: 'Mustang', engine: '5L', color: 'Yellow' },
    { make: 'Aston Martin', model: 'DB9', color: 'Silver' },
    { make: 'Dodge', model: 'Charger', color: 'Red' }
  ],
  parentClass: "table-test",
  placeholder: "-"
};

TODO

  • Column sorting,
  • Default styling with no-style option
  • Publish to npm with better package name.

About

React Table Component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published