react-pandas-table

1.1.1 • Public • Published

react-pandas-table

A library designed to render Python Pandas tables in a React environment.

NPM JavaScript Style Guide

Install

npm install --save react-pandas-table

Example Usage

import React from 'react'

import { BasicTable } from 'react-pandas-table'

const ExampleComponent = () => {
  return (
    <BasicTable
      data={exampleData}
      includeIndexCol={false}
      reformatCols={[
        {
          col: 'Exmaple Date Col',
          type: 'date',
          locale: 'en-GB',
          params: {
            year: 'numeric',
            month: 'long',
            day: 'numeric'
          }
        },
        {
          col: 'Example Currency Col',
          type: 'number',
          locale: 'en-GB',
          params: {
            style: 'currency',
            currency: 'EUR'
          }
        },
        {
          col: 'Example Percentage Col',
          type: 'number',
          locale: 'en-GB',
          params: {
            style: 'percent',
            minimumFractionDigits: 2
          }
        }
      ]}
      total={['Example Currency Col', 'Example Percentage Col']}
      headerStyles={{
        backgroundColor: '#000000',
        color: '#FFFFFF',
        padding: 10
      }}
      cellStyles={{
        backgroundColor: '#F3F4F6',
        color: '#000000',
        padding: 10
      }}
    />
  )
}

License

MIT © finnmaguire1998

Readme

Keywords

none

Package Sidebar

Install

npm i react-pandas-table

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

24 kB

Total Files

7

Last publish

Collaborators

  • finnmaguire98