bordered table

This commit is contained in:
afc163 2015-08-11 20:05:52 +08:00
parent 3be09f62f5
commit 137e40acae
3 changed files with 64 additions and 2 deletions

View File

@ -0,0 +1,41 @@
# 边框
- order: 11
添加表格边框线,`bordered={true}`。
---
````jsx
var Table = antd.Table;
var columns = [{
title: '姓名',
dataIndex: 'name',
render: function(text) {
return <a href="javascript:;">{text}</a>;
}
}, {
title: '年龄',
dataIndex: 'age'
}, {
title: '住址',
dataIndex: 'address'
}];
var data = [{
name: '胡彦斌',
age: 32,
address: '西湖区湖底公园1号'
}, {
name: '胡彦祖',
age: 42,
address: '西湖区湖底公园1号'
}, {
name: '李大嘴',
age: 32,
address: '西湖区湖底公园1号'
}];
React.render(<Table columns={columns} dataSource={data} bordered={true} />
, document.getElementById('components-table-demo-bordered'));
````

View File

@ -64,7 +64,8 @@ var AntTable = React.createClass({
prefixCls: 'ant-table',
useFixedHeader: false,
rowSelection: null,
size: 'normal'
size: 'normal',
bordered: false
};
},
@ -464,6 +465,9 @@ var AntTable = React.createClass({
if (this.props.size === 'small') {
classString += ' ant-table-small';
}
if (this.props.bordered) {
classString += ' ant-table-bordered';
}
columns = this.renderColumnsDropdown(columns);
return <div className="clearfix">
<Table

View File

@ -12,7 +12,7 @@
table {
width: 100%;
max-width: 100%;
border-collapse: separate;
border-collapse: collapse;
text-align: left;
}
@ -180,6 +180,23 @@
}
}
}
&.@{tablePrefixClass}-bordered {
border: 1px solid #E9E9E9;
border-bottom: 0;
overflow: hidden;
th {
border-bottom: 1px solid #E9E9E9;
}
th, td {
border-right: 1px solid #E9E9E9;
&:last-child {
border-right: 0;
}
}
}
}
.@{tablePrefixClass}-pagination {