Coder Social home page Coder Social logo

table's Introduction

rc-table

react table component

NPM version build status Test coverage gemnasium deps node version npm download

install

rc-table

Development

npm install
npm start

Usage

var Table = require('rc-table');

  var columns = [
    {title : 'header 1',dataIndex :'a', width:100},
    {id: '123',title : 'header 2',dataIndex :'b', width:100},
    {title : 'header 3',dataIndex : 'c',width:200},
    {title : 'operate',dataIndex : '',renderer :function (value,obj) {
      return <a href="#">edit</a>
    }}
  ];

  var data = [{a:'123'},{a:'cdd',b:'edd'},{a:'1333',c:'eee',d:2}];

  var table = React.renderComponent(
        <Table columns={columns} data={data} className="table"/>,
        document.getElementById('t1')
  );
  
// use table

API

property

columns

  • The columns config of table

    • title : The title of column
    • dataIndex : display the data field
    • width : The width of column. The width of the specific proportion calculation according to the width of the columns
    • renderer : The render function of cell , has two params. value : the text of this cell;obj : the record of this row

data

  • The Data to be shown

className

  • The css class this table to be used

Test Case

http://localhost:8000/tests/runner.html?coverage

Coverage

http://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8000/tests/runner.html?coverage

License

rc-table is released under the MIT license.

table's People

Contributors

dxq613 avatar popomore avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.