The react version for ftc-table
Last updated a year ago by wangyichen .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ftchinese/ftc-table-react 
SYNC missed versions from official npm registry.


The React version for ftc-table.

It provides some features for a table: sorting by each column, showing caculating results, fixing the table's head if necessary...


cd yourProject
npm install "@ftchinese/ftc-table-react" --save 



import React from 'react';
import ReactDOM from 'react-dom';

import {FtcTable, TableBodyRow} from '@ftchinese/ftc-table-react';

class App extends React.Component {
  constructor(props) {
  render() {
    const fieldsInfoForTable = [
        "fieldName": "Cheese",
        "fieldSubName": "Type of cheese",
        "dataIsNumberic": false,
        "disableSort": false
        "fieldName": "Bread",
        "fieldSubName": "Type of bread",
        "dataIsNumberic": false,
        "disableSort": false
        "field": "CostGBP",
        "fieldName": "Cost",
        "fieldSubName": "(GBP)",
        "dataIsNumberic": true,
        "disableSort": false
        "fieldName": "Cost",
        "dataIsNumberic": true,
        "disableSort": false
    const captionsInfoForTable = {
      top: "Top Caption",
      bottom: "Bottom Caption"
    const styleListValue = [
    const statisticInfoArr = ['sum', 'mean', 'median'];

    return (
        <TableBodyRow defaultOrder="0" data={
            "Cheese": "cheddar",
            "Bread": "rye",
        <TableBodyRow defaultOrder="1" data={
            "Cheese": "stilton",
            "Bread": "wholemeal",
        <TableBodyRow defaultOrder="2" data={
            "Cheese": "red leicester",
            "Bread": "white",

  <App />,


The exported components are FtcTable and TableBodyRow .

Props For FtcTable


Type Array of or one TableBodyRow. Required. The FtcTable should need TableBodyRow to be as children


Type Array of Object. Required. The information data for the fileds of the table's thead.The Object should has following prop:


Type String. Required. The unique code for one field.


Type String. Optional. The showing name for the field in the thead of table. If it is missing, the field will show instead.


Type String. Optional. The showing subname for the field in the thead of table.


Type Boolean. Optional. If it is true, the column of data of this field will be regarded as Number, which will effect the result of sorting of the data in the column and the style of the column.


Type Boolean. Optional. If it is true, the sorting for the data of this column will be disabled.


Type Object. Optional. The words for the captions of the table. It has two keys:


Type String. Optional. The words for the top caption. If it is missing. The table will have no top caption.


Type String. Optional. The words for the bottom caption. If it is missing. The table will have no bottom caption.


Type Array of String or Type String. The style name(s) for the table. There are 5 style names for choosing:

  • ftc-table--row-stripes: Add row stripe related styles to table, making the adjacent 2 rows with 2 colors.
  • ftc-table--horizontal-lines: Add horizontal lines to table.
  • ftc-table--vertical-lines: Add vertical lines to table.
  • "table--responsive-overflow": Add overflow responsive related styles to table.
  • "table--responsive-flat":Add flat responsive related styles to table.

The ftc-table--row-stripesftc-table--horizontal-linesftc-table--vertical-lines can be selected only one or selected two or three at one time.

The table--responsive-overflowtable--responsive-flat should be selected only one at one time. If they are both selected, the one writing last will go into effect. And if there is a prop addWrapperInfo(as follows), both of the responsive style will be invalid.


Type Array. Optional. The item of the Array should be one of 'sum', 'mean', 'median'. If it has values, the corresponding statistical results will be showed in the tfoot. The statistics are only for the column whose data are Number(That's to say, the dataIsNumberic of the column's corresponding data in fieldsInfo is true)


Type Object. Optional. The sizes of the wrapper of the table. It has two keys, width and height, which describe the length of the table's width and height. Both keys are required, if one of the keys are missing or the addWrapperInfo is missing, the table will not have a wrapper. If the table has a wrapper, the thead of the table will be fixed on top when vertically scrolling the content of the table.

The values of width and height can be String or Number. If they are String, they can be values for the CSS properties 'width' and 'height' such as '100%','80px'. If they are Number, they means 'px'.

Props For TableBodyRow


Type number.Optional. The default index for the row. The initially showing for the rows will follow this order. If it is missing, the initial orders are depended on the writing orders for the TableBodyRow.


Type Object. Required. The data for one row. The keys of it should be same as the value of field of the item of fieldsInfo in parent component FtcTable

Current Tags

  • 1.1.3                                ...           latest (a year ago)

5 Versions

  • 1.1.3                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 5
Last Month 10
Dependencies (12)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |