table-g
TypeScript icon, indicating that this package has built-in type declarations

0.1.47 • Public • Published

table-g


Enhanced table component based on antd with React

NPM version

Screenshot

Demo

online example: https://favori.gitee.io/gantd-landing (CodePen)

install

rc-tabs

Feature

  • Collapsible columns
  • Smooth scrolling under big data
  • Support in cell editing
  • Support Infinite data loading

Usage

import React from 'react';
import Table from 'table-g';

function BasicUse() {
   const columns = [
    {
      title: 'name',
      dataIndex: 'name',
      key: 'name',
      showTip: true,
    },
    {
      title: 'age',
      dataIndex: 'age',
      key: 'age',
    },
    {
      title: 'address',
      dataIndex: 'address',
      key: 'address',
    },
  ];

  const dataSource = useMemo(() => getList(), [])
  const [resizable, setresizable] = useState(true)

  const toggleResizable = useCallback(() => {
      setresizable(r => !r)
    },[])

  const headerRight = useMemo(() => {
    return <Button onClick={toggleResizable} >switch to resize columns</Button>
  }, [])

  return <Table
    columns={columns}
    dataSource={dataSource}
    resizable={resizable}
    headerRight={headerRight}
  />
}

React.render(<BasicUse/>, mountNode);

API

Documentation

Contact

Anthor

GantFDT

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i table-g

Weekly Downloads

33

Version

0.1.47

License

MIT

Unpacked Size

268 kB

Total Files

44

Last publish

Collaborators

  • wujiaxian
  • liuyanlu
  • favori
  • eyelly
  • vvey
  • zhangdousang
  • solinma
  • yunfang