'Bootstrap Table Icons Not Showing
I am creating a bootstrap-table (version 1.18) leveraged off of bootstrap version 4.5.2
And everything appears to be working properly except the table icons are not showing - however the table control functions they represent ARE working (i.e. the print button still works)
I'm thinking that I am missing an extension for the icons? But noting seems to reference that, and previous iterations based off of previous versions of the bootstrap and bootstrap-table DID work.
Below is are my extension imports and my table set up, along with two photos showing the mia icons with working buttons.
<!-- Style sheets -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<!-- JQUERY -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<!-- BOOTSTRAP -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<!-- BOOTSTRAP TABLE EXTENSIONS -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/bootstrap-table.min.css">
<script src="https://unpkg.com/[email protected]/dist/bootstrap-table.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/dist/extensions/filter-control/bootstrap-table-filter-control.css">
<script src="https://unpkg.com/[email protected]/dist/extensions/filter-control/bootstrap-table-filter-control.js"></script>
<script src="https://unpkg.com/[email protected]/dist/extensions/multiple-sort/bootstrap-table-multiple-sort.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/extensions/reorder-rows/bootstrap-table-reorder-rows.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/TableDnD/0.9.1/jquery.tablednd.js" integrity="sha256-d3rtug+Hg1GZPB7Y/yTcRixO/wlI78+2m08tosoRn7A=" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/dist/extensions/reorder-rows/bootstrap-table-reorder-rows.js"></script>
<script src="https://unpkg.com/[email protected]/dist/extensions/print/bootstrap-table-print.js"></script>
And the Table set up
<table id="varTable" class="table table-striped table-condensed table-hover table-sm table-responsive mx-auto" style='width: 90%; margin-left: 2%; margin-right: 2%' data-toggle="varTable" data-show-columns="true" data-pagination="true" data-pagination-pre-text="Previous" data-pagination-next-text="Next" data-page-list="[10, 25, 50, 100, all]" data-filter-control="true" data-show-search-clear-button="true" data-show-multi-sort="true" data-sort-priority='[{"sortName":"basic.chr.na"},{"sortName":"basic.pos.ba"}]' data-use-row-attr-func="true" data-reorderable-rows="true" data-show-print="true"> <thead>
Solution 1:[1]
I was having the same problem. What fixed it for me was manually adding the fontawesome style sheet.
<link rel="stylesheet" href="https://kit-free.fontawesome.com/releases/latest/css/free.min.css">
Solution 2:[2]
More recent versions of bootstrap-table (1.19.0 or newer) use bootstrap icons as default icons instead of fontawesome. To fix the missing icons, add the bootstrap-icons stylesheet, e.g., for version 1.8.1 of bootstrap-icons add:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kyle McCray |
Solution 2 | Jero Schäfer |