{"id":13880709,"url":"https://github.com/react-component/table","last_synced_at":"2025-06-21T19:05:55.244Z","repository":{"id":24145450,"uuid":"27534935","full_name":"react-component/table","owner":"react-component","description":"React Table","archived":false,"fork":false,"pushed_at":"2024-11-08T05:09:24.000Z","size":38186,"stargazers_count":1296,"open_issues_count":182,"forks_count":589,"subscribers_count":45,"default_branch":"master","last_synced_at":"2024-11-10T21:45:59.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://table.react-component.now.sh","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-component.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ant-design","patreon":null,"open_collective":"ant-design","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2014-12-04T10:17:17.000Z","updated_at":"2024-11-08T05:08:04.000Z","dependencies_parsed_at":"2023-09-23T03:22:43.563Z","dependency_job_id":"8873009e-a3f2-4970-b989-35679d582b80","html_url":"https://github.com/react-component/table","commit_stats":{"total_commits":1193,"total_committers":125,"mean_commits":9.544,"dds":0.7208717518860017,"last_synced_commit":"26f9746826a588478c0281ac84f34eaac80e45b6"},"previous_names":[],"tags_count":445,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-component","download_url":"https://codeload.github.com/react-component/table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225732632,"owners_count":17515525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:03:24.894Z","updated_at":"2024-11-24T09:32:21.682Z","avatar_url":"https://github.com/react-component.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ant-design","https://opencollective.com/ant-design"],"categories":["TypeScript"],"sub_categories":[],"readme":"# rc-table\n\nReact table component with useful functions.\n\n[![NPM version][npm-image]][npm-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-table.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-table\n[github-actions-image]: https://github.com/react-component/table/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/table/actions\n[coveralls-image]: https://img.shields.io/coveralls/react-component/table.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/react-component/table?branch=master\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/table/master.svg?style=flat-square\n[codecov-url]: https://codecov.io/gh/react-component/table/branch/master\n[david-url]: https://david-dm.org/react-component/table\n[david-image]: https://david-dm.org/react-component/table/status.svg?style=flat-square\n[david-dev-url]: https://david-dm.org/react-component/table?type=dev\n[david-dev-image]: https://david-dm.org/react-component/table/dev-status.svg?style=flat-square\n[download-image]: https://img.shields.io/npm/dm/rc-table.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-table\n[bundlephobia-url]: https://bundlephobia.com/result?p=rc-table\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-table\n\n## install\n\n[![rc-table](https://nodei.co/npm/rc-table.png)](https://npmjs.org/package/rc-table)\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## Example\n\nhttps://table-react-component.vercel.app/\n\n## Usage\n\n```js\nimport Table from 'rc-table';\n\nconst columns = [\n  {\n    title: 'Name',\n    dataIndex: 'name',\n    key: 'name',\n    width: 100,\n  },\n  {\n    title: 'Age',\n    dataIndex: 'age',\n    key: 'age',\n    width: 100,\n  },\n  {\n    title: 'Address',\n    dataIndex: 'address',\n    key: 'address',\n    width: 200,\n  },\n  {\n    title: 'Operations',\n    dataIndex: '',\n    key: 'operations',\n    render: () =\u003e \u003ca href=\"#\"\u003eDelete\u003c/a\u003e,\n  },\n];\n\nconst data = [\n  { name: 'Jack', age: 28, address: 'some where', key: '1' },\n  { name: 'Rose', age: 36, address: 'some where', key: '2' },\n];\n\nReact.render(\u003cTable columns={columns} data={data} /\u003e, mountNode);\n```\n\n## API\n\n### Properties\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| tableLayout | `auto` \\| `fixed` | `auto` \\| `fixed` for any columns is fixed or ellipsis or header is fixed | https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout |\n| prefixCls | String | rc-table |  |\n| className | String |  | additional className |\n| id | String |  | identifier of the container div |\n| useFixedHeader | Boolean | false | whether use separator table for header. better set width for columns |\n| scroll | Object | {x: false, y: false} | whether table can be scroll in x/y direction, `x` or `y` can be a number that indicated the width and height of table body |\n| expandable | Object |  | Config expand props |\n| expandable.defaultExpandAllRows | Boolean | false | Expand All Rows initially |\n| expandable.defaultExpandedRowKeys | String[] | [] | initial expanded rows keys |\n| expandable.expandedRowKeys | String[] |  | current expanded rows keys |\n| expandable.expandedRowRender | Function(recode, index, indent, expanded):ReactNode |  | Content render to expanded row |\n| expandable.expandedRowClassName | `string` \\| `(recode, index, indent) =\u003e string` |  | get expanded row's className |\n| expandable.expandRowByClick | boolean |  | Support expand by click row |\n| expandable.expandIconColumnIndex | Number | 0 | The index of expandIcon which column will be inserted when expandIconAsCell is false |\n| expandable.expandIcon | props =\u003e ReactNode |  | Customize expand icon |\n| expandable.indentSize | Number | 15 | indentSize for every level of data.i.children, better using with column.width specified |\n| expandable.rowExpandable | (record) =\u003e boolean |  | Config row support expandable |\n| expandable.onExpand | Function(expanded, record) |  | function to call when click expand icon |\n| expandable.onExpandedRowsChange | Function(expandedRows) |  | function to call when the expanded rows change |\n| expandable.fixed | String \\| Boolean | - | this expand icon will be fixed when table scroll horizontally: true or `left` or `right` and `expandIconColumnIndex` need to stay first or last |\n| rowKey | string or Function(record, index):string | 'key' | If rowKey is string, `record[rowKey]` will be used as key. If rowKey is function, the return value of `rowKey(record, index)` will be use as key. |\n| rowClassName | string or Function(record, index, indent):string |  | get row's className |\n| rowRef | Function(record, index, indent):string |  | get row's ref key |\n| data | Object[] |  | data record array to be rendered |\n| onRow | Function(record, index) |  | Set custom props per each row. |\n| onHeaderRow | Function(record, index) |  | Set custom props per each header row. |\n| showHeader | Boolean | true | whether table head is shown |\n| hidden | Boolean | `false` | Hidden column. |\n| title | Function(currentData) |  | table title render function |\n| footer | Function(currentData) |  | table footer render function |\n| emptyText | React.Node or Function | `No Data` | Display text when data is empty |\n| columns | Object[] |  | The columns config of table, see table below |\n| components | Object |  | Override table elements, see [#171](https://github.com/react-component/table/pull/171) for more details |\n| sticky | boolean \\| {offsetHeader?: number, offsetScroll?: number, getContainer?: () =\u003e Window \\| HTMLElement } | false | stick header and scroll bar |\n| summary | (data: readonly RecordType[]) =\u003e React.ReactNode | - | `summary` attribute in `table` component is used to define the summary row. |\n| rowHoverable | boolean | true | Table hover interaction |\n\n## Column Props\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| key | String |  | key of this column |\n| className | String |  | className of this column |\n| colSpan | Number |  | thead colSpan of this column |\n| title | React Node |  | title of this column |\n| dataIndex | String |  | display field of the data record |\n| width | String \\| Number |  | width of the specific proportion calculation according to the width of the columns |\n| minWidth | Number |  | the minimum width of the column, only worked when tableLayout is auto |\n| fixed | String \\| Boolean |  | this column will be fixed when table scroll horizontally: true or 'left' or 'right' |\n| align | String |  | specify how cell content is aligned |\n| ellipsis | Boolean |  | specify whether cell content be ellipsized |\n| rowScope | 'row' \\| 'rowgroup' |  | Set scope attribute for all cells in this column |\n| onCell | Function(record, index) |  | Set custom props per each cell. |\n| onHeaderCell | Function(record) |  | Set custom props per each header cell. |\n| render | Function(value, row, index) |  | The render function of cell, has three params: the text of this cell, the record of this row, the index of this row, it's return an object:{ children: value, props: { colSpan: 1, rowSpan:1 } } ==\u003e 'children' is the text of this cell, props is some setting of this cell, eg: 'colspan' set td colspan, 'rowspan' set td rowspan |\n\n## Summary Props\n\n### Table.Summary\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| key | String |  | key of this summary |\n| fixed | boolean \\| 'top' \\| 'bottom' | - | `true` fixes the summary row at the bottom of the table. `top` fixes the summary row at the top of the table, while `bottom` fixes it at the bottom. `undefined` or `false` makes the summary row scrollable along with the table. |\n\n### Table.Summary.Row\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| key | String |  | key of this summary |\n| className | String | - | className of this summary row |\n| style | React.CSSProperties | - | style of this summary row |\n| onClick | (e?: React.MouseEvent\\\u003cHTMLElement\u003e) =\u003e void | - | The `onClick` attribute in `Table.Summary.Row` component can be used to set a click event handler for the summary row. |\n\n## License\n\nrc-table is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Ftable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-component%2Ftable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Ftable/lists"}