mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
Add table column className demo
This commit is contained in:
parent
e323b0fc24
commit
57c12fa3ae
@ -16,8 +16,9 @@ const columns = [{
|
|||||||
return <a href="javascript:;">{text}</a>;
|
return <a href="javascript:;">{text}</a>;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
title: '年龄',
|
title: '资产',
|
||||||
dataIndex: 'age'
|
className: 'column-money',
|
||||||
|
dataIndex: 'money'
|
||||||
}, {
|
}, {
|
||||||
title: '住址',
|
title: '住址',
|
||||||
dataIndex: 'address'
|
dataIndex: 'address'
|
||||||
@ -26,20 +27,26 @@ const columns = [{
|
|||||||
const data = [{
|
const data = [{
|
||||||
key: '1',
|
key: '1',
|
||||||
name: '胡彦斌',
|
name: '胡彦斌',
|
||||||
age: 32,
|
money: '¥300,000.00',
|
||||||
address: '西湖区湖底公园1号'
|
address: '西湖区湖底公园1号'
|
||||||
}, {
|
}, {
|
||||||
key: '2',
|
key: '2',
|
||||||
name: '胡彦祖',
|
name: '胡彦祖',
|
||||||
age: 42,
|
money: '¥1,256,000.00',
|
||||||
address: '西湖区湖底公园1号'
|
address: '西湖区湖底公园1号'
|
||||||
}, {
|
}, {
|
||||||
key: '3',
|
key: '3',
|
||||||
name: '李大嘴',
|
name: '李大嘴',
|
||||||
age: 32,
|
money: '¥120,000.00',
|
||||||
address: '西湖区湖底公园1号'
|
address: '西湖区湖底公园1号'
|
||||||
}];
|
}];
|
||||||
|
|
||||||
ReactDOM.render(<Table columns={columns} dataSource={data} bordered={true} />
|
ReactDOM.render(<Table columns={columns} dataSource={data} bordered={true} />
|
||||||
, document.getElementById('components-table-demo-bordered'));
|
, document.getElementById('components-table-demo-bordered'));
|
||||||
````
|
````
|
||||||
|
|
||||||
|
````css
|
||||||
|
.column-money {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
````
|
||||||
|
@ -87,6 +87,7 @@ var dataSource = new Table.DataSource({
|
|||||||
| filterMultiple | 是否多选 | Boolean | | true |
|
| filterMultiple | 是否多选 | Boolean | | true |
|
||||||
| sorter | 排序函数,本地模式下为一个函数,远程模式下为布尔值 | Function or Boolean | | 无 |
|
| sorter | 排序函数,本地模式下为一个函数,远程模式下为布尔值 | Function or Boolean | | 无 |
|
||||||
| width | 列宽度 | String or Number | | 无 |
|
| width | 列宽度 | String or Number | | 无 |
|
||||||
|
| className | 列的 className | String | | 无 |
|
||||||
|
|
||||||
### dataSource
|
### dataSource
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
background: @table-head-background-color;
|
background: @table-head-background-color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
transition: background .3s ease;
|
transition: background .3s ease;
|
||||||
text-align: left;
|
|
||||||
|
|
||||||
.anticon-bars {
|
.anticon-bars {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
|
Loading…
Reference in New Issue
Block a user