This is a Table Example
<table class="table table-bordered table-responsive table-hover add-lineheight table_scroll">
<thead>
<tr>
<th ng-hide="hidecolumn == key" ng-repeat="(key, value) in localNew[0]">
{{key}}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="test in localNew">
<td ng-hide="hidecolumn == key" ng-repeat="(key, value) in test">
{{value}}
</td>
</tr>
</tbody>
</table>
In this example, the hidecolumn
function hides specific columns that are not wanted to be displayed. For instance, in the controller data is defined as follows:
$scope.localNew = [{ 'name': 'name1', 'age': 24, "salary": 2500, "s": 5 }, { 'name': 'name2', 'age': 26, "salary": 2600, "s": 5 }];
The variable used to hide a column is:
$scope.hidecolumn = "salary";
This functionality works correctly.
If there is a need to hide multiple columns, the scope variable can be defined like this:
$scope.hidecolumn = "name,salary";
Instructions on managing the HTML table to hide multiple columns would be greatly appreciated.