0

Building a table where the user can choose to hide some columns (month - or the indiviual series for that each month). Is it possible to use ng-show with a colgroup or col tag - so I don't need to add the ngshow to every cell? Can't seem to get it working...

<colgroup ng-repeat="mth in months" span="2" ng-show="mth.checked">
    <col  ng-show="headerOptions[0].selected" />
    <col  ng-show="headerOptions[1].selected" />
</colgroup>
collymitch
  • 105
  • 1
  • 3

1 Answers1

1

This has little to do with AngularJS and more to do with HTML/CSS.

Hiding columns in a HTML table is pain. There are some questions with answers here on SO already. Take a look at Hide/Show Column in an HTML Table and How to hide columns in HTML table?.

A performance tip could be to hide the entire table before hiding/showing the columns to avoid unnecessary reflow/repaint events.

Community
  • 1
  • 1
anddoutoi
  • 9,973
  • 4
  • 29
  • 28