Skip to content

Commit 866e07d

Browse files
committed
fix #465
1 parent 316c760 commit 866e07d

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/BootstrapTable.js

+6
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ class BootstrapTable extends Component {
250250
onMouseLeave={ this.handleMouseLeave }>
251251
<TableHeader
252252
ref='header'
253+
tableHeaderClass={ this.props.tableHeaderClass }
253254
style={ this.props.headerStyle }
254255
rowSelectType={ this.props.selectRow.mode }
255256
hideSelectColumn={ this.props.selectRow.hideSelectColumn }
@@ -265,6 +266,7 @@ class BootstrapTable extends Component {
265266
{ this.props.children }
266267
</TableHeader>
267268
<TableBody ref='body'
269+
tableBodyClass={ this.props.tableBodyClass }
268270
style={ { ...style, ...this.props.bodyStyle } }
269271
data={ this.state.data }
270272
columns={ columns }
@@ -911,6 +913,8 @@ BootstrapTable.propTypes = {
911913
containerStyle: PropTypes.object,
912914
headerStyle: PropTypes.object,
913915
bodyStyle: PropTypes.object,
916+
tableHeaderClass: PropTypes.string,
917+
tableBodyClass: PropTypes.string,
914918
options: PropTypes.shape({
915919
clearSearch: PropTypes.bool,
916920
sortName: PropTypes.string,
@@ -993,6 +997,8 @@ BootstrapTable.defaultProps = {
993997
containerStyle: undefined,
994998
headerStyle: undefined,
995999
bodyStyle: undefined,
1000+
tableHeaderClass: null,
1001+
tableBodyClass: null,
9961002
options: {
9971003
clearSearch: false,
9981004
sortName: undefined,

src/TableBody.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class TableBody extends Component {
2525
'table-bordered': this.props.bordered,
2626
'table-hover': this.props.hover,
2727
'table-condensed': this.props.condensed
28-
});
28+
}, this.props.tableBodyClass);
2929

3030
const isSelectRowDefined = this._isSelectRowDefined();
3131
const tableHeader = this.renderTableHeader(isSelectRowDefined);
@@ -283,6 +283,7 @@ TableBody.propTypes = {
283283
onRowClick: PropTypes.func,
284284
onSelectRow: PropTypes.func,
285285
noDataText: PropTypes.oneOfType([ PropTypes.string, PropTypes.object ]),
286-
style: PropTypes.object
286+
style: PropTypes.object,
287+
tableBodyClass: PropTypes.string
287288
};
288289
export default TableBody;

src/TableHeader.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TableHeader extends Component {
2727
const tableClasses = classSet('table', 'table-hover', {
2828
'table-bordered': this.props.bordered,
2929
'table-condensed': this.props.condensed
30-
});
30+
}, this.props.tableHeaderClass);
3131
let selectRowHeaderCol = null;
3232
if (!this.props.hideSelectColumn) selectRowHeaderCol = this.renderSelectRowHeader();
3333
let i = 0;
@@ -69,6 +69,7 @@ class TableHeader extends Component {
6969
}
7070
}
7171
TableHeader.propTypes = {
72+
tableHeaderClass: PropTypes.string,
7273
style: PropTypes.object,
7374
rowSelectType: PropTypes.string,
7475
onSort: PropTypes.func,

0 commit comments

Comments
 (0)