forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTable.jsx
38 lines (33 loc) · 922 Bytes
/
Table.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/** @jsx React.DOM */
import React from './react-es6';
import classSet from './react-es6/lib/cx';
import PropTypes from './PropTypes';
var Table = React.createClass({
propTypes: {
striped: React.PropTypes.bool,
bordered: React.PropTypes.bool,
condensed: React.PropTypes.bool,
hover: React.PropTypes.bool,
responsive: React.PropTypes.bool
},
render: function () {
var classes = {
'table': true,
'table-striped': this.props.striped,
'table-bordered': this.props.bordered,
'table-condensed': this.props.condensed,
'table-hover': this.props.hover
};
var table = this.transferPropsTo(
<table className={classSet(classes)}>
{this.props.children}
</table>
);
return this.props.responsive ? (
<div className="table-responsive">
{table}
</div>
) : table;
}
});
export default = Table;