Skip to content

Commit e60e607

Browse files
committed
1 parent 6650629 commit e60e607

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/BootstrapTable.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,14 @@ class BootstrapTable extends Component {
226226
let sortIndicator = this.props.options.sortIndicator;
227227
if (typeof this.props.options.sortIndicator === 'undefined') sortIndicator = true;
228228
return (
229-
<div className='react-bs-table-container'>
229+
<div className='react-bs-table-container' style={ this.props.containerStyle }>
230230
{ toolBar }
231-
<div className='react-bs-table' ref='table' style={ style }
231+
<div className='react-bs-table' ref='table' style={ { ...style, ...this.props.tableStyle } }
232232
onMouseEnter={ this.handleMouseEnter }
233233
onMouseLeave={ this.handleMouseLeave }>
234234
<TableHeader
235235
ref='header'
236+
style={ this.props.headerStyle }
236237
rowSelectType={ this.props.selectRow.mode }
237238
hideSelectColumn={ this.props.selectRow.hideSelectColumn }
238239
sortName={ sortInfo ? sortInfo.sortField : undefined }
@@ -247,7 +248,7 @@ class BootstrapTable extends Component {
247248
{ this.props.children }
248249
</TableHeader>
249250
<TableBody ref='body'
250-
style={ style }
251+
style={ { ...style, ...this.props.bodyStyle } }
251252
data={ this.state.data }
252253
columns={ columns }
253254
trClassName={ this.props.trClassName }
@@ -793,6 +794,10 @@ BootstrapTable.propTypes = {
793794
search: PropTypes.bool,
794795
columnFilter: PropTypes.bool,
795796
trClassName: PropTypes.any,
797+
tableStyle: PropTypes.object,
798+
containerStyle: PropTypes.object,
799+
headerStyle: PropTypes.object,
800+
bodyStyle: PropTypes.object,
796801
options: PropTypes.shape({
797802
clearSearch: PropTypes.bool,
798803
sortName: PropTypes.string,
@@ -862,6 +867,10 @@ BootstrapTable.defaultProps = {
862867
multiColumnSearch: false,
863868
columnFilter: false,
864869
trClassName: '',
870+
tableStyle: undefined,
871+
containerStyle: undefined,
872+
headerStyle: undefined,
873+
bodyStyle: undefined,
865874
options: {
866875
clearSearch: false,
867876
sortName: undefined,

src/TableHeader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class TableHeader extends Component {
3333
this._attachClearSortCaretFunc();
3434

3535
return (
36-
<div ref='container' className={ containerClasses }>
36+
<div ref='container' className={ containerClasses } style={ this.props.style }>
3737
<table className={ tableClasses }>
3838
<thead>
3939
<tr ref='header'>
@@ -82,6 +82,7 @@ class TableHeader extends Component {
8282
}
8383
}
8484
TableHeader.propTypes = {
85+
style: PropTypes.object,
8586
rowSelectType: PropTypes.string,
8687
onSort: PropTypes.func,
8788
onSelectAllRow: PropTypes.func,

0 commit comments

Comments
 (0)