mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
bordered table
This commit is contained in:
parent
3be09f62f5
commit
137e40acae
41
components/table/demo/bordered.md
Normal file
41
components/table/demo/bordered.md
Normal 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'));
|
||||
````
|
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user