Skip to content

Commit 0cc7d0b

Browse files
author
smartameer
committed
Adding Table with borderless feature
1 parent f5db238 commit 0cc7d0b

5 files changed

+18
-9
lines changed

css/react-bootstrap-table.css

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
}
44
.react-bs-table .table-header{
55
height: 37px;
6-
border-right-width: 1px;
7-
border-right-style: solid;
8-
border-right-color: rgb(221, 221, 221);
96
border-top-width: 1px;
107
border-top-style: solid;
118
border-top-color: rgb(221, 221, 221);
9+
border-bottom-width: 1px;
10+
border-bottom-style: solid;
11+
border-bottom-color: rgb(221, 221, 221);
1212
}
1313

1414
.react-bs-table .table-header > table{
1515
table-layout: fixed;
16-
border-right-style: hidden;
1716
border-top-style: hidden;
1817
}
1918

css/react-bootstrap-table.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/BootstrapTable.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@ class BootstrapTable extends React.Component{
129129
sortName={this.props.options.sortName}
130130
sortOrder={this.props.options.sortOrder}
131131
onSort={this.handleSort.bind(this)}
132-
onSelectAllRow={this.handleSelectAllRow.bind(this)}>
132+
onSelectAllRow={this.handleSelectAllRow.bind(this)}
133+
bordered={this.props.bordered}>
133134
{this.props.children}
134135
</TableHeader>
135136
<TableBody ref="body" data={this.state.data} columns={columns}
136137
striped={this.props.striped}
138+
bordered={this.props.bordered}
137139
hover={this.props.hover}
138140
keyField={this.store.getKeyField()}
139141
condensed={this.props.condensed}
@@ -376,6 +378,7 @@ BootstrapTable.propTypes = {
376378
height: React.PropTypes.string,
377379
data: React.PropTypes.array,
378380
striped: React.PropTypes.bool,
381+
bordered: React.PropTypes.bool,
379382
hover: React.PropTypes.bool,
380383
condensed: React.PropTypes.bool,
381384
pagination: React.PropTypes.bool,
@@ -410,6 +413,7 @@ BootstrapTable.propTypes = {
410413
BootstrapTable.defaultProps = {
411414
height: "100%",
412415
striped: false,
416+
bordered: true,
413417
hover: false,
414418
condensed: false,
415419
pagination: false,

src/TableBody.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ class TableBody extends React.Component{
1818
render(){
1919
var containerClasses = classSet("table-container");
2020

21-
var tableClasses = classSet("table", "table-bordered", {
21+
var tableClasses = classSet("table", {
2222
'table-striped': this.props.striped,
23+
'table-bordered': this.props.bordered,
2324
'table-hover': this.props.hover,
2425
'table-condensed': this.props.condensed
2526
});
@@ -200,6 +201,7 @@ TableBody.propTypes = {
200201
data: React.PropTypes.array,
201202
columns: React.PropTypes.array,
202203
striped: React.PropTypes.bool,
204+
bordered: React.PropTypes.bool,
203205
hover: React.PropTypes.bool,
204206
condensed: React.PropTypes.bool,
205207
keyField: React.PropTypes.string,

src/TableHeader.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ class TableHeader extends React.Component{
3838

3939
render(){
4040
var containerClasses = classSet("table-header");
41+
var tableClasses = classSet("table", "table-hover", {
42+
"table-bordered": this.props.bordered
43+
});
4144
var selectRowHeaderCol = this.props.hideSelectColumn?null:this.renderSelectRowHeader();
4245
this._attachClearSortCaretFunc();
4346

4447
return(
4548
<div className={containerClasses}>
46-
<table className="table table-hover table-bordered">
49+
<table className={tableClasses}>
4750
<thead>
4851
<tr ref="header">
4952
{selectRowHeaderCol}
@@ -83,7 +86,8 @@ TableHeader.propTypes = {
8386
onSelectAllRow: React.PropTypes.func,
8487
sortName: React.PropTypes.string,
8588
sortOrder: React.PropTypes.string,
86-
hideSelectColumn: React.PropTypes.bool
89+
hideSelectColumn: React.PropTypes.bool,
90+
bordered: React.PropTypes.bool
8791
};
8892

8993
TableHeader.defaultProps = {

0 commit comments

Comments
 (0)