table-listing

1.4.2 • Public • Published

table-listing

Library to render a table, from a list of objects.

NPM JavaScript Style Guide

Install

npm install --save table-listing

Usage

Available props

  • listTitle (String): The title of your table.

  • listTitles (Array of Objects): The title of each column in your table, the corresponding label in your listElements, and the type of the information. (Currently supported : string, date and number)

  • listElements (Array of Objects): A list of objects where each object represents a row in the table. The properties of each object should always be the same, in the same order, and their values represent the data for each cell in the table.

Example:

import TableListing from 'table-listing'

const listTitle = "Class 3 students"
const listTitles = [
  {
    "label": "First Name", 
    "elementLabel": "name", 
    "type": "string"
  }, 
  {
    "label": "Age", 
    "elementLabel": "age", 
    "type": "number"
  }
]
const listElements = [
  {
    "name": "John",
    "age": 12
  }, 
  {
    "name": "Elisa",
    "age": 13
  }
]

function Example() {
  return (
    <>
      <TableListing listTitle={listTitle} listTitles={listTitles} listElements={listElements}/>
    </>
  );
}

License

MIT © Jendoki

Readme

Keywords

none

Package Sidebar

Install

npm i table-listing

Weekly Downloads

9

Version

1.4.2

License

MIT

Unpacked Size

44.7 kB

Total Files

7

Last publish

Collaborators

  • jendoki