Add table column className demo

This commit is contained in:
afc163 2015-11-05 19:46:29 +08:00
parent e323b0fc24
commit 57c12fa3ae
3 changed files with 13 additions and 6 deletions

View File

@ -16,8 +16,9 @@ const columns = [{
return <a href="javascript:;">{text}</a>;
}
}, {
title: '年龄',
dataIndex: 'age'
title: '资产',
className: 'column-money',
dataIndex: 'money'
}, {
title: '住址',
dataIndex: 'address'
@ -26,20 +27,26 @@ const columns = [{
const data = [{
key: '1',
name: '胡彦斌',
age: 32,
money: '¥300,000.00',
address: '西湖区湖底公园1号'
}, {
key: '2',
name: '胡彦祖',
age: 42,
money: '¥1,256,000.00',
address: '西湖区湖底公园1号'
}, {
key: '3',
name: '李大嘴',
age: 32,
money: '¥120,000.00',
address: '西湖区湖底公园1号'
}];
ReactDOM.render(<Table columns={columns} dataSource={data} bordered={true} />
, document.getElementById('components-table-demo-bordered'));
````
````css
.column-money {
text-align: right;
}
````

View File

@ -87,6 +87,7 @@ var dataSource = new Table.DataSource({
| filterMultiple | 是否多选 | Boolean | | true |
| sorter | 排序函数,本地模式下为一个函数,远程模式下为布尔值 | Function or Boolean | | 无 |
| width | 列宽度 | String or Number | | 无 |
| className | 列的 className | String | | 无 |
### dataSource

View File

@ -24,7 +24,6 @@
background: @table-head-background-color;
font-weight: bold;
transition: background .3s ease;
text-align: left;
.anticon-bars {
margin-left: 4px;