# Usage []({{ site.repo }}/blob/master/docs/_i18n/{{ site.lang }}/getting-started/usage.md) --- Include Bootstrap library (if your project doesn't use it already) and `bootstrap-table.css` in the head tag your html document. ```html ``` 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). ```html <-- put your locale files after bootstrap-table.js --> ``` --- 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. ```html
Item ID Item Name Item Price
1 Item 1 $1
2 Item 2 $2
``` We can also use remote url data by setting `data-url="data1.json"` on a normal table. ```html
Item ID Item Name Item Price
``` ## Via JavaScript Call a bootstrap table with id table with JavaScript. ```html
``` ```js $('#table').bootstrapTable({ columns: [{ field: 'id', title: 'Item ID' }, { field: 'name', title: 'Item Name' }, { field: 'price', title: 'Item Price' }], data: [{ id: 1, name: 'Item 1', price: '$1' }, { id: 2, name: 'Item 2', price: '$2' }] }); ``` We can also use remote url data by setting `url: 'data1.json'`. ```js $('#table').bootstrapTable({ url: 'data1.json', columns: [{ field: 'id', title: 'Item ID' }, { field: 'name', title: 'Item Name' }, { field: 'price', title: 'Item Price' }, ] }); ```