Last active
September 27, 2017 13:25
-
-
Save AllenFang/b8379a60987c544cba063eea7c4aa12e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rowClassNameFormat(row, rowIdx) { | |
// row is whole row object | |
// rowIdx is index of row | |
return rowIdx % 2 === 0 ? 'td-column-function-even-example' : 'td-column-function-odd-example'; | |
} | |
class TrClassStringTable extends React.Component { | |
render() { | |
return ( | |
<BootstrapTable data={ products } trClassName={this.rowClassNameFormat}> | |
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn> | |
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn> | |
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn> | |
</BootstrapTable> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment