Home > Article > Web Front-end > bootstraptable method to hide columns
# Recommended: "How to hide columns in bootstraptable: 1. Hide through "bootstrapTable('hideColumn', 'GoodsId');"; 2. Hide through the attribute "visible: false".
bootstrap video tutorial》
The operating environment of this tutorial: Windows 10 system, bootstrap version 3.0. This method is suitable for all brands of computers.How to hide columns in bootstraptable:
hidden: true in bootstrapTable doesn’t work! The code on the Internet is this $(table).bootstrapTable('showColumn', 'Field to be hidden')First way<script type="text/javascript"> $(function () { LoadingDataListOrderRealItems(); $('#tableOrderRealItems').bootstrapTable('showColumn', 'ShopName'); $('#tableOrderRealItems').bootstrapTable('hideColumn', 'GoodsId'); }); </script>Second way:Hide: visible: false,Show: visible: true,The visible attribute does not have true or false, it is visible, invisible and gone.
visible: visible;
invisible: invisible, but takes up space;
gone: invisible, does not take up space, the control disappears from the layout.
columns:[ { title: 'id', field: 'id', align: 'center', valign: 'middle', width: '7%', visible: false }]
The above is the detailed content of bootstraptable method to hide columns. For more information, please follow other related articles on the PHP Chinese website!