@shubich/react-table

Building dynamic tables with React.js

Usage no npm install needed!

<script type="module">
  import shubichReactTable from 'https://cdn.skypack.dev/@shubich/react-table';
</script>

README

@shubich/react-table

React component for rendering lists to html table

NPM registry

Install

# NPM
npm install @shubich/react-table

Usage

Input

import * as React from "react";
import { render } from "react-dom";
import ReactTable from "@shubich/react-table";

const cars = [
  {
    mark: "BMW",
    model: "i8",
  },
  {
    mark: "Porsche",
    model: "911",
  },
  {
    mark: "Tesla",
    model: "Model S",
    "0-60 mph": "2.4s"
  }
];

function App() {
  return (
    <ReactTable
      data={cars}
      showIndex={true}
      indexName="id"
    />
  );
}

const rootElement = document.getElementById("root");
render(<App />, rootElement);

Output

| id | mark | model | 0-60 mph | | -- |-----------| --------|----------| | 0 | BMW | i8 | | | 1 | Porsche | 911 | | | 2 | Tesla | Model S | 2.4s |

Examples

CodeSandbox

License

@shubich/react-table is MIT licensed.