Skip to content

Commit

Permalink
fix #1009
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Feb 5, 2017
1 parent f3b324d commit 94b4451
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ class BootstrapTable extends Component {
export: column.props.export,
expandable: column.props.expandable,
index: i,
attrs: column.props.tdAttr
attrs: column.props.tdAttr,
style: column.props.tdStyle
};
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class TableBody extends Component {
onEdit={ this.handleEditCell }
width={ column.width }
onClick={ this.handleClickCell }
attrs={ column.attrs }>
attrs={ column.attrs }
style={ column.style }>
{ columnChild }
</TableColumn>
);
Expand Down
9 changes: 6 additions & 3 deletions src/TableColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ class TableColumn extends Component {
dataAlign,
hidden,
cellEdit,
attrs
attrs,
style
} = this.props;

const tdStyle = {
textAlign: dataAlign,
display: hidden ? 'none' : null
display: hidden ? 'none' : null,
...style
};

const opts = {};
Expand Down Expand Up @@ -113,7 +115,8 @@ TableColumn.propTypes = {
columnTitle: PropTypes.string,
children: PropTypes.node,
onClick: PropTypes.func,
attrs: PropTypes.object
attrs: PropTypes.object,
style: PropTypes.object
};

TableColumn.defaultProps = {
Expand Down
14 changes: 10 additions & 4 deletions src/TableHeaderColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ class TableHeaderColumn extends Component {
children,
caretRender,
className,
isOnlyHead
isOnlyHead,
thStyle: style
} = this.props;
const thStyle = {
textAlign: headerAlign || dataAlign,
display: hidden ? 'none' : null
display: hidden ? 'none' : null,
...style
};
if (!isOnlyHead) {
if (sortIndicator) {
Expand Down Expand Up @@ -259,7 +261,9 @@ TableHeaderColumn.propTypes = {
sortIndicator: PropTypes.bool,
export: PropTypes.bool,
expandable: PropTypes.bool,
tdAttr: PropTypes.object
tdAttr: PropTypes.object,
tdStyle: PropTypes.Object,
thStyle: PropTypes.Object
};

TableHeaderColumn.defaultProps = {
Expand Down Expand Up @@ -291,7 +295,9 @@ TableHeaderColumn.defaultProps = {
filter: undefined,
sortIndicator: true,
expandable: true,
tdAttr: undefined
tdAttr: undefined,
tdStyle: undefined,
thStyle: undefined
};

export default TableHeaderColumn;

0 comments on commit 94b4451

Please sign in to comment.