--- order: 29 title: en-US: Summary zh-CN: 总结栏 --- ## zh-CN 通过 `summary` 设置总结栏。使用 `Table.Summary.Cell` 同步 Column 的固定状态。你可以通过配置 `Table.Summary` 的 `fixed` 属性使其固定(`4.16.0` 支持)。 ## en-US Set summary content by `summary` prop. Sync column fixed status with `Table.Summary.Cell`. You can fixed it by set `Table.Summary` `fixed` prop(since `4.16.0`). ```tsx import { Table, Typography } from 'antd'; import type { ColumnsType } from 'antd/es/table'; import React from 'react'; const { Text } = Typography; interface DataType { key: string; name: string; borrow: number; repayment: number; } interface FixedDataType { key: React.Key; name: string; description: string; } const columns: ColumnsType = [ { title: 'Name', dataIndex: 'name', }, { title: 'Borrow', dataIndex: 'borrow', }, { title: 'Repayment', dataIndex: 'repayment', }, ]; const data: DataType[] = [ { key: '1', name: 'John Brown', borrow: 10, repayment: 33, }, { key: '2', name: 'Jim Green', borrow: 100, repayment: 0, }, { key: '3', name: 'Joe Black', borrow: 10, repayment: 10, }, { key: '4', name: 'Jim Red', borrow: 75, repayment: 45, }, ]; const fixedColumns: ColumnsType = [ { title: 'Name', dataIndex: 'name', fixed: true, width: 100, }, { title: 'Description', dataIndex: 'description', }, ]; const fixedData: FixedDataType[] = []; for (let i = 0; i < 20; i += 1) { fixedData.push({ key: i, name: ['Light', 'Bamboo', 'Little'][i % 3], description: 'Everything that has a beginning, has an end.', }); } const App: React.FC = () => ( <> { let totalBorrow = 0; let totalRepayment = 0; pageData.forEach(({ borrow, repayment }) => { totalBorrow += borrow; totalRepayment += repayment; }); return ( <> Total {totalBorrow} {totalRepayment} Balance {totalBorrow - totalRepayment} ); }} />
( Summary This is a summary content )} /> ); export default App; ```