Class name

E.bootstrap.table (0.2.0)

Methods

Method Parameters Returns Description Example
attr key, value this Add attribute key/value to component attr('id','mytable')
build string Build string of component markup build()
append jquery selector boolean Build and append string to DOM append('#mydiv')
mode condensed, striped, bordered this Set mode (.table-{{mode}}) mode('striped')
hover this Set hover option (.table-hover) hover()
footer this Set headers in footer footer()
headers any buildable this Add header header('Header One')
headers array this Set headers headers(['Header One','Header Two'])
row array this Add row row(['Row 1 Col 1','Row 1 Col 2'])
rows array (of arrays) this Set rows rows(['Row 1 Col 1','Row 1 Col 2'],['Row 2 Col 1','Row 2 Col 2'])

Examples

For simplicity, we'll use these predefined variables in all the examples.

var hdrs = [ '#', 'First Name', 'Last Name', 'Twitter' ];
var rows = [
	[ '1', 'Larry the Bird', null, '@twitter' ],
	[ '2', 'Twitter Bootstrap', null, '@getboostrap' ],
	[ '3', 'James', 'Linden', '@kodekrash' ],
	[ '4', 'Entegre UI Toolkit', null, '@entegreio' ]
];
Default
# First Name Last Name Twitter
1 Larry the Bird @twitter
2 Twitter Boostrap @getbootstrap
3 James Linden @kodekrash
4 Entegre UI Toolkit @entegreio
Condensed
# First Name Last Name Twitter
1 Larry the Bird @twitter
2 Twitter Boostrap @getbootstrap
3 James Linden @kodekrash
4 Entegre UI Toolkit @entegreio
Striped
# First Name Last Name Twitter
1 Larry the Bird @twitter
2 Twitter Boostrap @getbootstrap
3 James Linden @kodekrash
4 Entegre UI Toolkit @entegreio
Default with hover
# First Name Last Name Twitter
1 Larry the Bird @twitter
2 Twitter Boostrap @getbootstrap
3 James Linden @kodekrash
4 Entegre UI Toolkit @entegreio
Default with footer
# First Name Last Name Twitter
1 Larry the Bird @twitter
2 Twitter Boostrap @getbootstrap
3 James Linden @kodekrash
4 Entegre UI Toolkit @entegreio
# First Name Last Name Twitter
Last modified: 2016-02-05