Bootstrap Table
An extended Bootstrap table with radio, checkbox, sort, pagination, extensions and other added features.
To get started, check out:
LICENSE
NOTE: Bootstrap Table is licensed under The MIT License. Completely free, you can arbitrarily use and modify this plugin. If this plugin is useful to you, you can Star this repo, your support is my biggest motive force, thanks.
Features
- Created for Twitter Bootstrap (All versions supported)
- Responsive web design
- Scrollable Table with fixed headers
- Fully configurable
- Via data attributes
- Show/Hide columns
- Show/Hide headers
- Show/Hide footers
- Get data in JSON format using AJAX
- Simple column sorting with a click
- Format column
- Single or multiple row selection
- Powerful pagination
- Card view
- Detail view
- Localization
- Extensions
How to get it
Manual download
Use Releases page or the source.
Yarn
yarn add bootstrap-table
Npm
npm install bootstrap-table
CDN
You can source bootstrap-table directly from a CDN like CDNJS or bootcss or jsdelivr.
Contributing
For feature requests, bug reports or submitting pull requests, please ensure you first read CONTRIBUTING.md.
Reporting Issues
As stated above, please read CONTRIBUTING.md, especially Bug Reports
And as stated there, please provide an Online Example when creating issues!
It's really saves much time.
You can also use our examples template via Load Examples button:
Your feedback is very appreciated!
Acknowledgements
Thanks to everyone who have given feedback and submitted pull requests. A list of all the contributors can be found here. This project exists thanks to all the people who contribute. [Contribute].
Release History
Look at the Change Log
Local develop
To develop bootstrap-table locally please run:
mkdir bootstrap-table-dev
cd bootstrap-table-dev
git clone https://github.com/wenzhixin/bootstrap-table
git clone https://github.com/wenzhixin/bootstrap-table-examples
yarn add http-server
npx http-server
And then open: http://localhost:8081/bootstrap-table-examples
Local build
To build bootstrap-table locally please run:
npm run build
Result will appear in dist
directory.
PayPal Sponsors
OpenCollective Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
OpenCollective Backers
Support this project by becoming a backer. Your image will show up here with a link to your website. [Become a backer]
Improving filter control
Improving filter control extension
Default options:
Column options:
Scenarios
Integrations
Update docs
Fix https://github.com/wenzhixin/bootstrap-table/issues/5541 (https://live.bootstrap-table.com/code/djhvscf/9665) Fix https://github.com/wenzhixin/bootstrap-table/issues/5588 (https://live.bootstrap-table.com/code/djhvscf/9666) Fix https://github.com/wenzhixin/bootstrap-table/issues/4998 (https://live.bootstrap-table.com/code/djhvscf/9667) Fix https://github.com/wenzhixin/bootstrap-table/issues/5468 (https://live.bootstrap-table.com/code/djhvscf/9690) Fix #5684 (https://live.bootstrap-table.com/code/djhvscf/9691) Fix https://github.com/wenzhixin/bootstrap-table/issues/4984 (https://live.bootstrap-table.com/code/djhvscf/9692) ~~Remove from scope https://github.com/wenzhixin/bootstrap-table/issues/5573.~~ See https://github.com/wenzhixin/bootstrap-table/issues/5968 Fix https://github.com/wenzhixin/bootstrap-table/issues/5446 (https://live.bootstrap-table.com/code/djhvscf/7411) ~~Remove from scope https://github.com/wenzhixin/bootstrap-table/issues/3298~~ Fix https://github.com/wenzhixin/bootstrap-table/issues/5146 (https://live.bootstrap-table.com/code/djhvscf/9694) Fix https://github.com/wenzhixin/bootstrap-table/issues/5690 (https://live.bootstrap-table.com/code/djhvscf/7438) Fix https://github.com/wenzhixin/bootstrap-table/issues/5572 (https://live.bootstrap-table.com/code/djhvscf/7445) Fix #5713 (https://live.bootstrap-table.com/code/djhvscf/9695) ~~Remove from scope https://github.com/wenzhixin/bootstrap-table/issues/5848~~ Fix https://github.com/wenzhixin/bootstrap-table/issues/5960 (https://live.bootstrap-table.com/code/djhvscf/9696) Fix https://github.com/wenzhixin/bootstrap-table/issues/5774 (https://live.bootstrap-table.com/code/djhvscf/9719) Fix https://github.com/wenzhixin/bootstrap-table/issues/5820 (https://live.bootstrap-table.com/code/djhvscf/9720) Fix https://github.com/wenzhixin/bootstrap-table/issues/5828 (https://live.bootstrap-table.com/code/djhvscf/9721) Fix https://github.com/wenzhixin/bootstrap-table/issues/5833 (https://live.bootstrap-table.com/code/djhvscf/9722) Fix https://github.com/wenzhixin/bootstrap-table/issues/5859 (https://live.bootstrap-table.com/code/djhvscf/9723) Fix https://github.com/wenzhixin/bootstrap-table/issues/5630 (https://live.bootstrap-table.com/code/djhvscf/9726) Fix https://github.com/wenzhixin/bootstrap-table/issues/5687 (https://live.bootstrap-table.com/code/djhvscf/9863) Fix https://github.com/wenzhixin/bootstrap-table/issues/6004 (https://live.bootstrap-table.com/code/UtechtDustin/10038)
data-side-pagination="server" not working
Hello, i'm new on Github
i have to make a boostrap table with sorting/pagin/filtering lot of datas in ASP MVC application.
i found boostrap-table and it look great !
i have a problem when i add data-pagination="true" and data-side-pagination="server" but the table is empty or "No matching records found". without paging it working.
this is my controller
public JsonResult JsonGrid() { List resultats = uow.Repository().GetAlls().OrderByDescending(e => e.DateResultat).ToList();
}
My PartialView with my tab
table id="gridTable" data-toggle="table" data-url="/Resultats/JsonGrid" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]" data-search="true" data-height="300"> thead tr th data-sortable="true" data-field="Flag">PEC th> th data-field="PMRQTOTM">PMRQTOTM th> th data-field="PMRQ">PMRQ th> tr thead table>
and my main view
div id="Render">@Html.Partial("Grille", Model)div
Thanks !!
Own Theme for the bootstrap-table
fix #4364
How do i get Data from json array?
I have a data: [{"id":404,"description":"PowerEdge 6300","price":7500,"onhand":16,"supplierId":302, "suppliers":[{"name":"DELL","webSite":"http://dell.com"}]}
i want to get suppliers.name field, how do i get that data field ?
关于使用server端分页,如何保存用户所有的复选框选择问题
$table.on('check.bs.table uncheck.bs.table ' + 'check-all.bs.table uncheck-all.bs.table', function () { $remove.prop('disabled', !$table.bootstrapTable('getSelections').length);
getIdSelections方法只能获得当前页面的选择,但是翻页后就会丢失之前保存的数据,我看到您的示例代码中给予了提示,但是具体怎么实现保存用户所有的复选框选择还是没有思路,能否给予点指引呢
server-side pagination not displaying pages or row count ; search not working ; sort not working
Hi. I'm new here. I just switched my pagination over to server-side, with the default parameters, as indicated on the example page, and a bunch of javascript related things aren't working.
'Showing 1 to 0 of 0 rows' , with no page controls on the right-hand side.
My table is set set up like
Am I missing something in the setup to activate it? I could not find another issue related to this one.
Am I missing some javascript somewhere to get the server-side pagination set up properly?
Thanks for your help.
Plan
What I want to do in the future or have already completed.
ui-table
or other better name.cannot load json data
Hi togeher,
My Files
nodes.json: http://paste.debian.net/hidden/85d8c632/ getData.html: http://paste.debian.net/hidden/b9df2a32/ welcome.html http://paste.debian.net/hidden/10c94b9b/
Problem
No matching records found!
Anyone ideas?
Sort by multiple columns
Is there a way to initialize a bootstrap-table to be sorted by multiple columns?
Suppose you have a table like this:
| Target Date | Priority | | --- | --- | | 2/2/2002 | Medium | | 1/1/2013 | High | | 1/1/2012 | High | | 1/1/2014 | High |
I want the default view to look like this (sorted first by Priority descending, then Target Date ascending).
| Target Date | Priority | | --- | --- | | 1/1/2012 | High | | 1/1/2013 | High | | 1/1/2014 | High | | 2/2/2002 | Medium |
Group and Ungroup table rows based on column name
In the boot strap table, group and un-group table rows based on column name. For example in a given table below grouping is done using column workflow name
How to add an ID to the "tr" ?
Hello,
How can I do that please ? In Symfony Twig I tried that :
But the class not appear in my html... why ?
Using data-cell-style and data-formatter on the same cell/column
Bootstraptable version(s) affected
1.21.2
Description
I have a table with multiple columns where cell in column C = cell in column B - cell in column A. This is established using data-formatter and returning the difference between cell A & B. I also use Cell-Style to add a class to the cell in case the value is greater than 0.
The problem is that it seems that cell-style function runs before data-formatter function which means at the time the check of value within the cell is greater than zero happens before the cell content is calculated via data-formatter function
Example(s)
Using data-cell-style and data-formatter on the same cell/column
Possible Solutions
Is there a way to ensure cell-style function runs only after the data-formatter function and the cell content is populated?
Thank you
Additional Context
No response
Added new table options "copyUnique" and "copyToLowerCase".
🤔Type of Request
🔗Resolves an issue?
📝Changelog
Added a new table option
copyUnique
to copy only unique values to clipboard. Added a new table optioncopyToLowerCase
to convert values to lowercase; when used withcopyUnique
, guarantees uniqueness if there is any character case mismatch.💡Example(s)?
https://live.bootstrap-table.com/code/mmaravillo/13892
☑️Self Check before Merge
⚠️ Please check all items below before reviewing. ⚠️
Table does not follow Addrbar
Description
The extension for Addrbar is added and enabled. Next, when switching pages on the pagination the parameters in the url are changing, but clicking on return (go back or forward button) the table does not change accordingly, stays static unless the page is refreshed with F5. (Auto)-refresh also doesn't follow the Addrbar.
I'm using server side processing. Maybe I missed something. But I dunno what. (added extension in scripts, enabled addrbar by stating true, I guess this is all?) I've put the table options which I tried in the example.
Thanks for your time in advance!
Example(s)
https://live.bootstrap-table.com/code/DataSupplier/13882
After destroying bootstrap-table custom view events not remove
Bootstraptable version(s) affected
1.21.2
Description
When custom view body rendered, I add some listeners on custom view element. but when I destroy bootstrap-table, event 'custom-view-post-body.bs.table' not remove. the event bound many times.
Example(s)
Possible Solutions
initTable function
Additional Context
No response
Extension filter-control work incorrectly if create multiple tables with data-height attribute
Bootstraptable version(s) affected
1.21.2
Description
I create two tables, both defined data-height, but values of second table appeared in the filter of first table incorrectly, and the second table's filter shows no selection.
In another case, create two tables, only define data-weight in the second table, but the second table's filter could not clear by select the empty value.
Example(s)
Case A, two tables, both defined height: https://live.bootstrap-table.com/code/shigure-j/13748 Case B: two tables, second one defined height: https://live.bootstrap-table.com/code/shigure-j/13749
Please check the 'Item Price' column's filter
Possible Solutions
The reason seems like that some functions get the fixed table head by search from whole dom but not related table https://github.com/wenzhixin/bootstrap-table/blob/4a4d39cdfb5c8a241826b7496e2348ecda3ee514/src/extensions/filter-control/utils.js#L593 https://github.com/wenzhixin/bootstrap-table/blob/4a4d39cdfb5c8a241826b7496e2348ecda3ee514/src/extensions/filter-control/utils.js#L21 https://github.com/wenzhixin/bootstrap-table/blob/4a4d39cdfb5c8a241826b7496e2348ecda3ee514/src/extensions/filter-control/utils.js#L603 https://github.com/wenzhixin/bootstrap-table/blob/4a4d39cdfb5c8a241826b7496e2348ecda3ee514/src/extensions/filter-control/bootstrap-table-filter-control.js#L529 I edit these lines like below , and it works in my case, but i'm not sure is it right to fix this problem
const fixedHeader = that.$el.find('thead');
Additional Context
No response
Overriding issues
Description
I'm no longer able to restore data changes back to original data source by overriding function("initData"). What I'm I missing?