2016-03-31 09:40:55 +08:00
|
|
|
---
|
2016-11-22 10:11:12 +08:00
|
|
|
order: 11
|
2016-08-15 07:54:01 +08:00
|
|
|
title:
|
|
|
|
en-US: border, title and footer
|
2016-11-14 14:26:08 +08:00
|
|
|
zh-CN: 带边框
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-08-11 20:05:52 +08:00
|
|
|
|
2016-08-15 07:54:01 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2016-07-21 15:14:42 +08:00
|
|
|
添加表格边框线,页头和页脚。
|
2015-08-11 20:05:52 +08:00
|
|
|
|
2016-08-15 08:07:03 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Add border, title and footer for table.
|
|
|
|
|
2017-02-13 10:55:53 +08:00
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Table } from 'antd';
|
|
|
|
|
|
|
|
const columns = [{
|
2016-10-02 08:38:16 +08:00
|
|
|
title: 'Name',
|
2015-08-11 20:05:52 +08:00
|
|
|
dataIndex: 'name',
|
2016-09-27 10:06:34 +08:00
|
|
|
render: text => <a href="#">{text}</a>,
|
2015-08-11 20:05:52 +08:00
|
|
|
}, {
|
2016-10-02 08:38:16 +08:00
|
|
|
title: 'Cash Assets',
|
2015-11-05 19:46:29 +08:00
|
|
|
className: 'column-money',
|
2016-05-03 14:15:29 +08:00
|
|
|
dataIndex: 'money',
|
2015-08-11 20:05:52 +08:00
|
|
|
}, {
|
2016-10-02 08:38:16 +08:00
|
|
|
title: 'Address',
|
2016-05-03 14:15:29 +08:00
|
|
|
dataIndex: 'address',
|
2015-08-11 20:05:52 +08:00
|
|
|
}];
|
|
|
|
|
2015-10-28 20:55:49 +08:00
|
|
|
const data = [{
|
2015-08-28 15:22:09 +08:00
|
|
|
key: '1',
|
2016-10-02 08:38:16 +08:00
|
|
|
name: 'John Brown',
|
2015-11-05 19:46:29 +08:00
|
|
|
money: '¥300,000.00',
|
2016-10-02 08:38:16 +08:00
|
|
|
address: 'New York No. 1 Lake Park',
|
2015-08-11 20:05:52 +08:00
|
|
|
}, {
|
2015-08-28 15:22:09 +08:00
|
|
|
key: '2',
|
2016-10-02 08:38:16 +08:00
|
|
|
name: 'Jim Green',
|
2015-11-05 19:46:29 +08:00
|
|
|
money: '¥1,256,000.00',
|
2016-10-02 08:38:16 +08:00
|
|
|
address: 'London No. 1 Lake Park',
|
2015-08-11 20:05:52 +08:00
|
|
|
}, {
|
2015-08-28 15:22:09 +08:00
|
|
|
key: '3',
|
2016-10-02 08:38:16 +08:00
|
|
|
name: 'Joe Black',
|
2015-11-05 19:46:29 +08:00
|
|
|
money: '¥120,000.00',
|
2016-10-02 08:38:16 +08:00
|
|
|
address: 'Sidney No. 1 Lake Park',
|
2015-08-11 20:05:52 +08:00
|
|
|
}];
|
|
|
|
|
2016-08-17 15:47:29 +08:00
|
|
|
ReactDOM.render(
|
|
|
|
<Table
|
|
|
|
columns={columns}
|
|
|
|
dataSource={data}
|
|
|
|
bordered
|
2016-10-02 08:38:16 +08:00
|
|
|
title={() => 'Header'}
|
|
|
|
footer={() => 'Footer'}
|
2016-08-17 15:47:29 +08:00
|
|
|
/>
|
|
|
|
, mountNode);
|
2015-08-11 20:05:52 +08:00
|
|
|
````
|
2015-11-05 19:46:29 +08:00
|
|
|
|
|
|
|
````css
|
2017-03-22 20:24:48 +08:00
|
|
|
th.column-money,
|
|
|
|
td.column-money {
|
2017-04-05 11:51:21 +08:00
|
|
|
text-align: right!important;
|
2017-03-22 20:24:48 +08:00
|
|
|
}
|
2015-11-05 19:46:29 +08:00
|
|
|
````
|