0.0.10 • Published 3 months ago
rc-table-lite v0.0.10
API
Table
Property | Description | Type | Default | |
---|---|---|---|---|
columns | Columns of table | ColumnsType[] | - | |
dataSource | Data record array to be displayed | object[] | - | |
rowKey | Row's unique key, could be a string or function that returns a string | string | function(record): string | key | |
rowClassName | Row's className | function(record, index): string | key | |
scroll | Whether the table can be scrollable, config | object | - | |
sticky | Set sticky header and scroll bar | boolean | {offsetHeader?: number, offsetScroll?: number, getContainer?: () => HTMLElement} | - |
tableLayout | The table-layout attribute of table element | - | auto | fixed | fixed when header/columns are fixed, or using column.ellipsis | |
onRow | Set props on per row | function(record, index) | - |
Column
Property | Description | Type | Default |
---|---|---|---|
align | The specify which way that column is aligned | left | right | center | left |
className | The className of this column | string | - |
colSpan | Span of this column's title | number | - |
key | Unique key of this column | string | - |
render | Renderer of the table cell. The return value should be a ReactNode | function(text, record, index) {} | - |
sorter | Sort function for local sort, see Array.sort's compareFunctio | function | boolean | { compare: function, multiple: number } | - |
title | Title of this column | ReactNode | ({ sortOrder, sortColumn, filters }) => ReactNode | - |
width | Width of this column | string | number | - |
onCell | Set props on per cell | function(record, rowIndex) | - |
onHeaderCell | Set props on per header cell | function(record, rowIndex) | - |
onCell | Set props on per cell | function(record, rowIndex) | - |
children | Multi-level header settings | Column[] | - |
expandable
Property | Description | Type | Default |
---|---|---|---|
expandedRowClassName | Expanded row's className | function(record, index, indent): string | - |
expandedRowRender | Expanded container render for each row | function(record, index, indent, expanded): ReactNode | - |
expandedRowKeys | Current expanded row keys | string[] | - |