This package has been deprecated

Author message:

move to @the-/ui-table ( https://github.com/the-labo/the/tree/master/packages/ui-table#readme )

the-table

3.0.23 • Public • Published

the-table

Build Status npm Version JS Standard

Table for the-components

Installation

$ npm install the-table --save

Usage

'use strict'

import React from 'react'
import { TheTable, TheTableStyle } from 'the-table'
import { TheInputStyle } from 'the-input'

const { Head, Body, Row, Cell, HeaderCell, CheckboxCell } = TheTable

class ExampleComponent extends React.PureComponent {
  constructor (props) {
    super(props)
    this.state = {
      row0: false,
      row1: false
    }
  }

  render () {
    const s = this
    const { state } = s
    return (
      <div>
        <TheTableStyle/>
        <TheInputStyle/>
        <TheTable>
          <Head>
            <Row>
              <HeaderCell
              />
              <HeaderCell>Name</HeaderCell>
              <HeaderCell>Number</HeaderCell>
              <HeaderCell></HeaderCell>
            </Row>
          </Head>
          <Body>
          <Row selected={state.row0}>
            <CheckboxCell value={state.row0}
                          name='row0'
                          onUpdate={(v) => s.setState(v)}
            >foo</CheckboxCell>
            <Cell>foo</Cell>
            <Cell>1234</Cell>
            <Cell/>
          </Row>

          <Row selected={state.row1}>
            <CheckboxCell value={state.row1}
                          name='row1'
                          onUpdate={(v) => s.setState(v)}
            >foo</CheckboxCell>
            <Cell>foo</Cell>
            <Cell>1234</Cell>
            <Cell/>
          </Row>
          </Body>
        </TheTable>

        <hr/>

        <TheTable empty
                  alt="This is an empty table!"
        />
      </div>

    )
  }
}

export default ExampleComponent

Components

TheTable

Table for the-components

Props

Name Type Description Default
alt node Alt for empty 'Data Not found'
empty bool Show as empty false
width bool Show as wide ``
role 'grid'
wide false

TheTableStyle

Style for TheTable

Props

Name Type Description Default
options object Style options {}

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i the-table

Weekly Downloads

16

Version

3.0.23

License

MIT

Unpacked Size

91.3 kB

Total Files

28

Last publish

Collaborators

  • okunishinishi