diff --git a/README.md b/README.md
index 5adb71f89..ec1289528 100644
--- a/README.md
+++ b/README.md
@@ -133,6 +133,7 @@ React.render(
, mountNode);
| fixed | String \| Boolean | | this column will be fixed when table scroll horizontally: true or 'left' or 'right' |
| align | String | | specify how cell content is aligned |
| ellipsis | Boolean | | specify whether cell content be ellipsized |
+| resizable | Boolean | | column resize |
| rowScope | 'row' \| 'rowgroup' | | Set scope attribute for all cells in this column |
| onCell | Function(record, index) | | Set custom props per each cell. |
| onHeaderCell | Function(record) | | Set custom props per each header cell. |
diff --git a/assets/index.less b/assets/index.less
index bfa245b03..64bfe1eef 100644
--- a/assets/index.less
+++ b/assets/index.less
@@ -63,9 +63,42 @@
}
}
+ &-column-resizing {
+ cursor: col-resize;
+ }
+
&-cell {
background: #f4f4f4;
+ &-resize-handle {
+ position: absolute;
+ top: 0;
+ inset-inline-end: 0;
+ width: 4px;
+ height: 100%;
+ cursor: col-resize;
+ z-index: 1;
+ background: red;
+ }
+
+ &-resize-line {
+ position: absolute;
+ width: 4px;
+ background: red;
+ height: 100%;
+ top: 0;
+ transform: translateX(-50%);
+ z-index: 2;
+ }
+
+ &-fix-left &-resize-handle {
+ right: 0
+ }
+
+ &-fix-right &-resize-handle {
+ left: 0
+ }
+
&-fix-left,
&-fix-right {
z-index: 2;
diff --git a/docs/examples/column-resize.tsx b/docs/examples/column-resize.tsx
index a3f15cbbc..81b33bb42 100644
--- a/docs/examples/column-resize.tsx
+++ b/docs/examples/column-resize.tsx
@@ -1,95 +1,106 @@
-import React from 'react';
-import { Resizable } from 'react-resizable';
-import Table from 'rc-table';
+import React, { useState } from 'react';
+import Table, { INTERNAL_HOOKS } from 'rc-table';
+import type { ColumnType } from 'rc-table';
import '../../assets/index.less';
-import 'react-resizable/css/styles.css';
-import type { ColumnType } from '@/interface';
-const ResizableTitle = props => {
- const { onResize, width, ...restProps } = props;
+const data = [
+ { a: '123', b: 'xxxxxxxx xxxxxxxx', d: 3, key: '1' },
+ { a: 'cdd', b: 'edd12221 edd12221', d: 3, key: '2' },
+ { a: '133', c: 'edd12221 edd12221', d: 2, key: '3' },
+ { a: '133', c: 'edd12221 edd12221', d: 2, key: '4' },
+ { a: '133', c: 'edd12221 edd12221', d: 2, key: '5' },
+ { a: '133', c: 'edd12221 edd12221', d: 2, key: '6' },
+ { a: '133', c: 'edd12221 edd12221', d: 2, key: '7' },
+ { a: '133', c: 'edd12221 edd12221', d: 2, key: '8' },
+ { a: '133', c: 'edd12221 edd12221', d: 2, key: '9' },
+];
- if (!width) {
- return | ;
- }
+const Demo = () => {
+ const [widthMap, setWidthMap] = useState