diff --git a/examples/js/column/column-title-table.js b/examples/js/column/column-title-table.js new file mode 100644 index 000000000..cad6db72d --- /dev/null +++ b/examples/js/column/column-title-table.js @@ -0,0 +1,32 @@ +/* eslint max-len: 0 */ +import React from 'react'; +import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; + + +const products = []; + +function addProducts(quantity) { + const startId = products.length; + for (let i = 0; i < quantity; i++) { + const id = startId + i; + products.push({ + id: id, + name: 'Item name ' + id, + price: 2100 + i + }); + } +} + +addProducts(5); + +export default class ColumnAlignTable extends React.Component { + render() { + return ( + + Product ID + Product Name + Product Price + + ); + } +} diff --git a/examples/js/column/demo.js b/examples/js/column/demo.js index b6b701cd0..3555c0cfc 100644 --- a/examples/js/column/demo.js +++ b/examples/js/column/demo.js @@ -3,6 +3,7 @@ import React from 'react'; import ColumnAlignTable from './column-align-table'; import ColumnWidthTable from './column-width-table'; import ColumnHideTable from './column-hide-table'; +import ColumnTitleTable from './column-title-table'; class Demo extends React.Component { render() { @@ -35,6 +36,15 @@ class Demo extends React.Component { +
+
+
Column Title Example
+
+
Source in /examples/js/column/column-title-table.js
+ +
+
+
); }