react-bootstrap-table2/docs
Allen 6110663075
fix #128
* implement custom row classes

* add story for customizing row classes

* add test for rowClasses

* patch docs for rowClasses
2017-10-30 14:24:39 +08:00
..
cell-edit.md refine row selection 2017-10-18 01:13:06 -05:00
columns.md fix #104 2017-10-20 00:44:25 -05:00
development.md Improve development setup experience by fixing misspelled areas 2017-10-07 04:16:33 -05:00
README.md fix #128 2017-10-30 14:24:39 +08:00
row-selection.md fix #119 2017-10-29 14:58:33 +08:00

Documentation

BootstrapTable Props

Required

Optional

keyField(required) - [String]

Tells react-bootstrap-table2 which column is unique.

data(required) - [Array]

Provides data for your table. It accepts a single Array object.

columns(required) - [Object]

Accepts a single Array object, please see columns definition for more detail.

caption - [String | Node]

Same as HTML caption tag, you can set it as String or a React JSX.

striped - [Bool]

Same as bootstrap .table-striped class for adding zebra-stripes to a table.

bordered - [Bool]

Same as bootstrap .table-bordered class for adding borders to a table and table cells.

hover - [Bool]

Same as bootstrap .table-hover class for adding mouse hover effect (grey background color) on table rows.

condensed - [Bool]

Same as bootstrap .table-condensed class for making a table more compact by cutting cell padding in half.

cellEdit - [Object]

Makes table cells editable, please see cellEdit definition for more detail.

selectRow - [Object]

Makes table rows selectable, please see selectRow definition for more detail.

rowStyle = [Object | Function]

Custom the style of table rows:

<BootstrapTable data={ ... } columns={ ... } rowStyle={ { backgroundColor: 'red' } } />

This prop also accept a callback function for flexible to custom row style:

const rowStyle = (row, rowIndex) => {
  return { ... };
};

<BootstrapTable data={ ... } columns={ ... } rowStyle={ rowStyle } />

rowClasses = [String | Function]

Custom the style of table rows:

<BootstrapTable data={ ... } columns={ ... } rowClasses="custom-row-class" />

This prop also accept a callback function for flexible to custom row style:

const rowClasses = (row, rowIndex) => {
  return 'custom-row-class';
};

<BootstrapTable data={ ... } columns={ ... } rowClasses={ rowClasses } />

defaultSorted - [Array]

defaultSorted accept an object array which allow you to define the default sort columns when first render.

const defaultSorted = [{
  dataField: 'name', // if dataField is not match to any column you defined, it will be ignored.
  order: 'desc' // desc or asc
}];