# rctable2

> a Table UI component for react

Latest version **1.0.4** (published 2019-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install rctable2
pnpm add rctable2
yarn add rctable2
bun add rctable2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-10-25 |
| First published | 2019-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 93.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | gio |
| Maintainers | agiose |
| Keywords | react, ui |

## Links

- npm: https://www.npmjs.com/package/rctable2
- Repository: https://github.com/aGiose/rctable2
- npm.io page: https://npm.io/package/rctable2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2019-10-25
- 1.0.3 — 2019-10-25
- 1.0.2 — 2019-10-24
- 1.0.1 — 2019-10-24
- 1.0.0 — 2019-10-17

## README

### rctable2
react table ui


### install 
npm install rctable2 --save

### Usage

```javascript
import {Table} from 'rctable2'

const columns = [
  {
    title:'Name',
    dataIndex:'name',
    index:'name',
    align:'center',
    width:100,
    onCell : (record) => {
      return {
        onClick:(e) => {
          console.log(e,record);
        }
      }
    },
  },{
    title:<div>Major</div>,
    dataIndex:'major',
    index:'major',
    align:'center',
    width:200,
    onCell : (text,record) => {
      return {
        onClick:(e) => {
          console.log(e);
        }
      }
    },
  },{
    title:'Class',
    dataIndex:'class',
    index:'class',
    align:'center',
    width:100,
    onCell : (record) => {
      return {
        onClick:(e) => {
          console.log(e);
          
        }
      }
    },
    sort:(a,b) => a - b,

  },{
    title:'Id',
    dataIndex:'id',
    index:'id',
    align:'center',
    width:100,
    sort:(a,b) => a.id - b.id,
  }
]

const data = [
  {
    name:'Ben',
    id:1,
    major:'Physic',
    class:'1414'
  },
  {
    name:'Alice',
    id:3,
    major:'Physic',
    class:'1414'
  },
  {
    name:'Jone',
    id:2,
    major:'Physic',
    class:'1414'
  }
]

<Table 
        rowClass = {(index) => `index${index}`}
        className = 'table-test-class'
        hideFilter = {true}
        pagination = {{pageSize:2}}
        columns = {columns}
         data = {data} 
         onChange = {(record,pagination,filter) => {
           console.log(record,pagination,filter);
           
         }}
         onRow = {(record) => {

          return {
            onClick:(e) => {
              console.log('row');
            }
          }
        }}/>
```

### API

| Name | Type | Default | Description |
| - | :-: | :-: | :-: |
| columns | 	Object[] | [] | The columns config of table, see table below |

---
_Source: https://npm.io/package/rctable2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
