Browse Source

docs: Update Table scroll docs (#20204)

pull/20216/head
二货机器人 5 years ago
committed by GitHub
parent
commit
b07d95b0dd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      components/table/demo/fixed-columns.md
  2. 2
      components/table/index.en-US.md
  3. 2
      components/table/index.zh-CN.md

4
components/table/demo/fixed-columns.md

@ -13,6 +13,8 @@ title:
>
> 建议指定 `scroll.x` 为大于表格宽度的固定值或百分比。注意,且非固定列宽度之和不要超过 `scroll.x`
**注意:v4 版本固定列通过 sticky 实现,IE 11 会降级成横向滚动。**
## en-US
To fix some columns and scroll inside other columns, and you must set `scroll.x` meanwhile.
@ -21,6 +23,8 @@ To fix some columns and scroll inside other columns, and you must set `scroll.x`
>
> A fixed value which is greater than table width for `scroll.x` is recommended. The sum of unfixed columns should not greater than `scroll.x`.
**Note: v4 using sticky to implement fixed effect. IE 11 will downgrade to horizontal scroll.**
```jsx
import { Table } from 'antd';

2
components/table/index.en-US.md

@ -125,7 +125,7 @@ One of the Table `columns` prop for describing the table's columns, Column has t
| filterIcon | Customized filter icon | ReactNode\|(filtered: boolean) => ReactNode | `false` |
| filterMultiple | Whether multiple filters can be selected | boolean | `true` |
| filters | Filter menu config | object\[] | - |
| fixed | Set column to be fixed: `true`(same as left) `'left'` `'right'` | boolean\|string | `false` |
| fixed | (IE not support) Set column to be fixed: `true`(same as left) `'left'` `'right'` | boolean\|string | `false` |
| key | Unique key of this column, you can ignore this prop if you've set a unique `dataIndex` | string | - |
| render | Renderer of the table cell. The return value should be a ReactNode, or an object for [colSpan/rowSpan config](#components-table-demo-colspan-rowspan) | Function(text, record, index) {} | - |
| sorter | Sort function for local sort, see [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)'s compareFunction. If you need sort buttons only, set to `true` | Function\|boolean | - |

2
components/table/index.zh-CN.md

@ -130,7 +130,7 @@ const columns = [
| filterIcon | 自定义 filter 图标。 | ReactNode\|(filtered: boolean) => ReactNode | false |
| filterMultiple | 是否多选 | boolean | true |
| filters | 表头的筛选菜单项 | object\[] | - |
| fixed | 列是否固定,可选 `true`(等效于 left) `'left'` `'right'` | boolean\|string | false |
| fixed | (IE 下无效)列是否固定,可选 `true`(等效于 left) `'left'` `'right'` | boolean\|string | false |
| key | React 需要的 key,如果已经设置了唯一的 `dataIndex`,可以忽略这个属性 | string | - |
| render | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引,@return 里面可以设置表格[行/列合并](#components-table-demo-colspan-rowspan) | Function(text, record, index) {} | - |
| sorter | 排序函数,本地排序使用一个函数(参考 [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 的 compareFunction),需要服务端排序可设为 true | Function\|boolean | - |

Loading…
Cancel
Save