diff --git a/assets/index.less b/assets/index.less index d9c10fe5b..0d3ca1c73 100644 --- a/assets/index.less +++ b/assets/index.less @@ -38,6 +38,15 @@ box-sizing: border-box; } + .@{tablePrefixCls}-title { + padding: 16px 8px; + border-top: 1px solid #e9e9e9; + } + + .@{tablePrefixCls}-content { + position: relative; + } + .@{tablePrefixCls}-footer { padding: 16px 8px; border-bottom: 1px solid #e9e9e9; diff --git a/examples/title.html b/examples/title.html new file mode 100644 index 000000000..e69de29bb diff --git a/examples/title.js b/examples/title.js new file mode 100644 index 000000000..27c728966 --- /dev/null +++ b/examples/title.js @@ -0,0 +1,32 @@ +/* eslint-disable no-console,func-names,react/no-multi-comp */ +const React = require('react'); +const ReactDOM = require('react-dom'); +const Table = require('rc-table'); +require('rc-table/assets/index.less'); + +const columns = [ + {title: '表头1', dataIndex: 'a', key: 'a', width: 100}, + {id: '123', title: '表头2', dataIndex: 'b', key: 'b', width: 100}, + {title: '表头3', dataIndex: 'c', key: 'c', width: 200}, + { + title: '操作', dataIndex: '', key: 'd', render: function() { + return 操作; + }, + }, +]; + +const data = [{a: '123', key: '1'}, {a: 'cdd', b: 'edd', key: '2'}, {a: '1333', c: 'eee', d: 2, key: '3'}]; + +const title = (currentData) => { + return