From 57c12fa3aef3d026f7bb4efca5655d4f5832fad2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 5 Nov 2015 19:46:29 +0800 Subject: [PATCH] Add table column className demo --- components/table/demo/bordered.md | 17 ++++++++++++----- components/table/index.md | 1 + style/components/table.less | 1 - 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/components/table/demo/bordered.md b/components/table/demo/bordered.md index 12b4211fe4..a80b265390 100644 --- a/components/table/demo/bordered.md +++ b/components/table/demo/bordered.md @@ -16,8 +16,9 @@ const columns = [{ return {text}; } }, { - 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( , document.getElementById('components-table-demo-bordered')); ```` + +````css +.column-money { + text-align: right; +} +```` diff --git a/components/table/index.md b/components/table/index.md index d68bd977a2..314dc81240 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -87,6 +87,7 @@ var dataSource = new Table.DataSource({ | filterMultiple | 是否多选 | Boolean | | true | | sorter | 排序函数,本地模式下为一个函数,远程模式下为布尔值 | Function or Boolean | | 无 | | width | 列宽度 | String or Number | | 无 | +| className | 列的 className | String | | 无 | ### dataSource diff --git a/style/components/table.less b/style/components/table.less index a51942487d..6bc5e0cd37 100644 --- a/style/components/table.less +++ b/style/components/table.less @@ -24,7 +24,6 @@ background: @table-head-background-color; font-weight: bold; transition: background .3s ease; - text-align: left; .anticon-bars { margin-left: 4px;