Socket
Socket
Sign inDemoInstall

bootstrap-table

Package Overview
Dependencies
0
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bootstrap-table

An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)


Version published
Weekly downloads
138K
increased by17.83%
Maintainers
1
Created
Weekly downloads
 

Package description

What is bootstrap-table?

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.

What are bootstrap-table's main functionalities?

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' }
    ]
  });
});

Other packages similar to bootstrap-table

Changelog

Source

1.21.2

Core
  • New: Added sortResetPage option to reset the page number when sorting.
  • Update: Fixed overwrite default option bug.
  • Update: Updated es-ES, es-CR locale.
  • Update: Improved scss style and lint.
  • Update: Used scss vars for sorting background image URLs.
Extensions
  • New(custom-view): Added onToggleCustomView event.
  • Update(cookie): Fixed cookie name compare bug on using cookiesEnabled option.
  • Update(custom-view): Fixed showCustomView option cannot work.
  • Update(filter-control): Fixed bug while using a select filter and set searchFormatter to false.
  • Update(filter-control): Fixed missing class when specifying iconSize.
  • Update(reorder-rows): Updated default value to reorder-rows-on-drag-class of onDragClass option.

Readme

Source

Bootstrap Table

Build Status GitHub version Donate Backers on Open Collective Sponsors on Open Collective Package Quality

An extended Bootstrap table with radio, checkbox, sort, pagination, extensions and other added features.

To get started, check out:

List of donators

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:

Online Editor

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

Be sure to use a current version of yarn/npm. To build bootstrap-table locally please run:

Yarn

yarn install
yarn build

Npm

npm install
npm run build

Result will appear in dist directory.

PayPal Sponsors

Write my essay services from Edubirdie

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]

Keywords

FAQs

Last updated on 12 Dec 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc