Angular Material Table - how to place *ngIf on whole column?

I have an Angular Material Table and would like to place an ngIf on the whole column so the whole column, header & data cells only show if the condition is true. I can place it on the data cell with little issue but I can't seem to work how to place it on the ng-container or on the mat-header-cell.

I have tried using ngFor and then using an ngIf, I have tried wrapping the header in a div or a table header & row but no luck.

result is the object, which has a property of websiteUrl


<table mat-table matSort [dataSource]="dataSource">
    
    <ng-container matColumnDef="websiteUrl">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Website Link</th>
        <td mat-cell *matCellDef="let result">
            <div *ngIf="showWebsiteLink===1">
                <div *ngIf="websiteLinkVisible(result)">
                    <a (click)="copyLink(result.websiteUrl)">
                        Copy Link
                    </a>
                </div>
            </div>
        </td>
    </ng-container>

    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
    <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>

</table>


I made a very simple example for you. To remove the entire col you would need to use *ngIf to remove it from the template when someCondition is false. And also you would need to remove the same col name from displayedColumns array. The latter is more important. In the example I have removed col 'weight'.

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  name = 'Angular 5';
  displayedColumns = ['position', 'name', 'weight', 'symbol'];
  dataSource = new MatTableDataSource<Element>(ELEMENT_DATA);
  someCondition: boolean = false;
  
  constructor() {
    if (!this.someCondition) {
      this.displayedColumns.splice(2,1);
    }
  }
}

https://stackblitz.com/edit/angular-material-table-data-source-kdttsz?file=app%2Fapp.component.ts