Usage
Include Bootstrap library (if your project doesn't use it already) and bootstrap-table.css in the head tag your html document.
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="bootstrap-table.css">
Include jQuery library, bootstrap library (if your project doesn’t use it already) and bootstrap-table.js in the head tag or at the very bottom of your document, just before the closing body tag (usually recommended for better performance).
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="bootstrap-table.js"></script>
The Bootstrap Table plugin displays data in a tabular format, via data attributes or JavaScript.
Via data attributes
Activate bootstrap table without writing JavaScript. Set data-toggle="table" on a normal table.
<table data-toggle="table" data-url="data.json">
<thead>
...
</thead>
</table>
Via JavaScript
Call a bootstrap table with id table with JavaScript.
$('#table').bootstrapTable({
url: 'data.json'
});
Options
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-
, as in data-url="data.json"
. More options see the Documentation or the Examples.