Search code examples
javascripttwitter-bootstrap-3bootstrap-table

javascript bootstrap-table initialized unwillingly


I am having problem with bootstrap-table, it automatically initializes and turn everything into the its style on onload or onReady event. But I want to use other table or just the standard table. It sometimes initializes all table on page but sometimes not. I can't find a solution on their document.

Do anybody know how it selects the table it wants to init by default?


Solution

  • As stated in docs (see usage) bootstrap-tables are initialized in two ways:

    • without writing JavaScript and setting data-toggle="table" attribute of <table> HTML element
    • in Javascript calling .bootstrapTable(options) method on jQuery element (e.g $('#table'))

    Other tables on a web page are not influenced.

    Check this example on jsfiddle: https://jsfiddle.net/beaver71/q5ctg2js/