How to use rc-table - 2 common examples

To help you get started, we’ve selected a few rc-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cncjs / cncjs / src / web / components / Table / Table.jsx View on Github external
const renderWithTooltip = (value, tooltip) => {
    if (typeof value === 'string') {
        tooltip = value;
    }
    return (<div className="overflow-ellipsis" title={tooltip}>{value}</div>);
};

class Table extends Component {
    static propTypes = {
        ...RCTable.propTypes,
        title: PropTypes.func,
        footer: PropTypes.func,
        border: PropTypes.bool
    };
    static defaultProps = {
        ...RCTable.defaultProps,
        border: true
    };

    render() {
        const {
            className,
            title,
            footer,
            border,
            data,
            ...props
        } = this.props;

        // default render field value with tooltip
        props.columns = props.columns.map((obj) => {
            obj.render = obj.render || renderWithTooltip;
github cncjs / cncjs / src / web / components / Table / Table.jsx View on Github external
import classNames from 'classnames';
import React, { Component, PropTypes } from 'react';
import RCTable from 'rc-table';
import styles from './index.styl';

const renderWithTooltip = (value, tooltip) => {
    if (typeof value === 'string') {
        tooltip = value;
    }
    return (<div className="overflow-ellipsis" title={tooltip}>{value}</div>);
};

class Table extends Component {
    static propTypes = {
        ...RCTable.propTypes,
        title: PropTypes.func,
        footer: PropTypes.func,
        border: PropTypes.bool
    };
    static defaultProps = {
        ...RCTable.defaultProps,
        border: true
    };

    render() {
        const {
            className,
            title,
            footer,
            border,
            data,

rc-table

table ui component for react

MIT
Latest version published 1 month ago

Package Health Score

81 / 100
Full package analysis

Popular rc-table functions