Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
bootstrap-table
Advanced tools
An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3).
The bootstrap-table npm package is a powerful library for creating dynamic, responsive, and feature-rich tables using Bootstrap. It provides a wide range of functionalities such as sorting, pagination, searching, and more, making it easy to manage and display large datasets in a user-friendly manner.
Basic Table Initialization
This code initializes a basic table with three columns (ID, Name, Price) and two rows of data. The table is created using the bootstrapTable method, which takes an object with columns and data properties.
$(document).ready(function() {
$('#table').bootstrapTable({
columns: [{
field: 'id',
title: 'ID'
}, {
field: 'name',
title: 'Name'
}, {
field: 'price',
title: 'Price'
}],
data: [{
id: 1,
name: 'Item 1',
price: '$1'
}, {
id: 2,
name: 'Item 2',
price: '$2'
}]
});
});
Pagination
This code demonstrates how to enable pagination in a bootstrap-table. The pagination property is set to true, and the pageSize property is set to 5, meaning the table will display 5 rows per page.
$(document).ready(function() {
$('#table').bootstrapTable({
pagination: true,
pageSize: 5,
columns: [{
field: 'id',
title: 'ID'
}, {
field: 'name',
title: 'Name'
}, {
field: 'price',
title: 'Price'
}],
data: [
{ id: 1, name: 'Item 1', price: '$1' },
{ id: 2, name: 'Item 2', price: '$2' },
{ id: 3, name: 'Item 3', price: '$3' },
{ id: 4, name: 'Item 4', price: '$4' },
{ id: 5, name: 'Item 5', price: '$5' },
{ id: 6, name: 'Item 6', price: '$6' }
]
});
});
Search Functionality
This code adds a search box to the table, allowing users to filter the table data based on their input. The search property is set to true to enable this functionality.
$(document).ready(function() {
$('#table').bootstrapTable({
search: true,
columns: [{
field: 'id',
title: 'ID'
}, {
field: 'name',
title: 'Name'
}, {
field: 'price',
title: 'Price'
}],
data: [
{ id: 1, name: 'Item 1', price: '$1' },
{ id: 2, name: 'Item 2', price: '$2' },
{ id: 3, name: 'Item 3', price: '$3' },
{ id: 4, name: 'Item 4', price: '$4' },
{ id: 5, name: 'Item 5', price: '$5' },
{ id: 6, name: 'Item 6', price: '$6' }
]
});
});
Sorting
This code enables sorting for each column in the table. The sortable property is set to true for the table and each column, allowing users to sort the data by clicking on the column headers.
$(document).ready(function() {
$('#table').bootstrapTable({
sortable: true,
columns: [{
field: 'id',
title: 'ID',
sortable: true
}, {
field: 'name',
title: 'Name',
sortable: true
}, {
field: 'price',
title: 'Price',
sortable: true
}],
data: [
{ id: 1, name: 'Item 1', price: '$1' },
{ id: 2, name: 'Item 2', price: '$2' },
{ id: 3, name: 'Item 3', price: '$3' },
{ id: 4, name: 'Item 4', price: '$4' },
{ id: 5, name: 'Item 5', price: '$5' },
{ id: 6, name: 'Item 6', price: '$6' }
]
});
});
react-table is a lightweight, fast, and extendable data grid built for React. It provides a flexible API for building complex tables with features like sorting, filtering, and pagination. Compared to bootstrap-table, react-table is more suited for React applications and offers a more modern and customizable approach.
ag-grid is a fully-featured and highly customizable JavaScript data grid. It supports a wide range of features including sorting, filtering, pagination, and more. ag-grid is known for its performance and is suitable for large datasets. Compared to bootstrap-table, ag-grid offers more advanced features and better performance for enterprise-level applications.
handsontable is a JavaScript/HTML5 data grid component with Excel-like features. It supports a wide range of functionalities such as data validation, sorting, filtering, and more. handsontable is ideal for applications that require a spreadsheet-like interface. Compared to bootstrap-table, handsontable provides a more interactive and Excel-like experience.
An extended Bootstrap table with radio, checkbox, sort, pagination, extensions and other added features.
To get started, check out:
NOTE: Bootstrap Table is licensed under the 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.
Use Releases page or the source.
bower install bootstrap-table
npm install bootstrap-table
You can source bootstrap-table directly from a CDN like CDNJS or bootcss or jsdelivr.
For feature requests, bug reports or submitting pull requests, please ensure you first read CONTRIBUTING.md.
As stated above, please read CONTRIBUTING.md, especially Bug Reports
And as stated there, please provide jsFiddle when creating issues!
It's really saves much time.
You can also use these for templates:
Your feedback is very appreciated!
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].
Look at the Change Log
To build bootstrap-table locally please run:
npm run grunt
Result will appear in dist
directory.
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
1.12.2
FAQs
An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
The npm package bootstrap-table receives a total of 72,784 weekly downloads. As such, bootstrap-table popularity was classified as popular.
We found that bootstrap-table demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.