New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json-to-table-pagination

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-to-table-pagination

Take an array of JSON objects and convert to reactjs table component with pagination in it

  • 1.3.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

json-to-table-pagination

When an array of JSON objects is passed to json-to-table-pagination, it will return the json values in a table format and adds pagination to it.

  1. Pass an array of objects, it will return a reactjs component with table and pagination
  2. Can select number of rows in a table per page
  3. Can go to any page number
  4. Click on any column header to sort in ascending/descending order
  5. Customize header background color
  6. Customize pagination arrows by showing either arrows or text in pagination
  7. By default nested objects are stringified and displayed. You can set 'flattenObjects' to true which flattens the objects and then displays
  8. Click on any value in the table and the value gets highlighted so that it can be copied easily

NPM JavaScript Style Guide

Install

npm install --save json-to-table-pagination

Usage

import React from 'react'
import { JSONToTable } from 'json-to-table-pagination'

const App = () => {
    const users = [
        {
            id: '111',
            firstname: 'Ram',
            lastname: 'Akunuru',
            email: 'ram@gmail.com'
        },
        {
            id: '222',
            firstname: 'Tony',
            lastname: 'Stark',
            email: 'tony@gmail.com'
        },
        {
            id: '333',
            firstname: 'Captain',
            lastname: 'America',
            email: 'captain@gmail.com'
        },
        ...
    ]

    // Below are the default options
    const options = {
        bgColor: '#1E88E5',
        useArrowIcons: true,
        flattenObjects: false
    }

    return <JSONToTable jsonFile={users} options={options} />
}

export default App

Alt text Alt text

License

MIT ©

Keywords

FAQs

Package last updated on 12 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc